You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(447) |
Nov
(163) |
Dec
(57) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(172) |
Feb
|
Mar
(123) |
Apr
(64) |
May
(1) |
Jun
(278) |
Jul
(89) |
Aug
(97) |
Sep
(62) |
Oct
(53) |
Nov
(119) |
Dec
(60) |
| 2006 |
Jan
(76) |
Feb
(1094) |
Mar
(363) |
Apr
(163) |
May
(57) |
Jun
(43) |
Jul
(39) |
Aug
(15) |
Sep
(33) |
Oct
(62) |
Nov
(8) |
Dec
|
| 2007 |
Jan
(9) |
Feb
(34) |
Mar
(2) |
Apr
(14) |
May
(8) |
Jun
(40) |
Jul
(21) |
Aug
(1) |
Sep
(20) |
Oct
(15) |
Nov
(26) |
Dec
|
| 2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Karsten W. <kar...@us...> - 2006-03-10 22:27:06
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2899/Common/headers Modified Files: Tag: pre_int64_branch WinSockNetEvents.h frontierdefs.h Log Message: long overdue commit update Index: WinSockNetEvents.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/WinSockNetEvents.h,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** WinSockNetEvents.h 11 Jan 2005 22:48:00 -0000 1.3 --- WinSockNetEvents.h 10 Mar 2006 22:26:58 -0000 1.3.6.1 *************** *** 103,107 **** /* Set up a listner on a port */ ! extern boolean fwsNetEventListenStream (unsigned long port, long depth, bigstring callback, unsigned long refcon, unsigned long * stream, unsigned long ipaddr, long hdatabase); /* get the status of a stream */ --- 103,107 ---- /* Set up a listner on a port */ ! extern boolean fwsNetEventListenStream (unsigned long port, long depth, bigstring lcallback, unsigned long refcon, unsigned long * stream, unsigned long ipaddr, long hdatabase); /* get the status of a stream */ Index: frontierdefs.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/frontierdefs.h,v retrieving revision 1.7.6.2 retrieving revision 1.7.6.3 diff -C2 -d -r1.7.6.2 -r1.7.6.3 *** frontierdefs.h 14 Feb 2006 11:40:04 -0000 1.7.6.2 --- frontierdefs.h 10 Mar 2006 22:26:58 -0000 1.7.6.3 *************** *** 83,89 **** --- 83,94 ---- // kw 2006-01-27 --- make new data types #define LONGINT_LONGDATE 1 + // kw - 2006-02-13 --- a test for the AE-memory leak #define AEDISPOSAL 1 + // kw - 2006-02-15 --- oplanglist accelerator + #define OPLANGLISTACCEL 0 + + #ifdef MACVERSION #define macBirdRuntime 1 |
|
From: Karsten W. <kar...@us...> - 2006-03-10 22:27:03
|
Update of /cvsroot/frontierkernel/Frontier/Common/IowaRuntime/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2899/Common/IowaRuntime/Source Modified Files: Tag: pre_int64_branch iowascript.c Log Message: long overdue commit update Index: iowascript.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/IowaRuntime/Source/iowascript.c,v retrieving revision 1.3.6.1 retrieving revision 1.3.6.2 diff -C2 -d -r1.3.6.1 -r1.3.6.2 *** iowascript.c 14 Feb 2006 11:36:00 -0000 1.3.6.1 --- iowascript.c 10 Mar 2006 22:26:57 -0000 1.3.6.2 *************** *** 509,522 **** if (flgetreturn) ! #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ - copydatahandle (&resultdesc, hreturns); ! #else ! ! *hreturns = resultdesc.dataHandle; ! #endif else AEDisposeDesc (&resultdesc); --- 509,523 ---- if (flgetreturn) ! { #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ copydatahandle (&resultdesc, hreturns); ! #if AEDISPOSAL == 1 ! // possible memleak here ! AEDisposeDesc(&resultdesc); ! #endif #else ! *hreturns = resultdesc.dataHandle; #endif + } else AEDisposeDesc (&resultdesc); *************** *** 535,551 **** if (ec == noErr) { ! ! #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ ! ! datahandletostring (&errordesc, errorstring); ! ! #else ! ! texthandletostring (errordesc.dataHandle, errorstring); ! ! #endif ! AEDisposeDesc (&errordesc); ! } else copystring ("\pThe script generated an error, but no message was provided.", errorstring); --- 536,547 ---- if (ec == noErr) { ! #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ ! datahandletostring (&errordesc, errorstring); ! #else ! texthandletostring (errordesc.dataHandle, errorstring); ! #endif ! AEDisposeDesc (&errordesc); ! } else copystring ("\pThe script generated an error, but no message was provided.", errorstring); |
|
From: creecode <icr...@us...> - 2006-03-10 22:01:36
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21687 Modified Files: setupFrontier Log Message: popup text for email password on setup webpage Index: setupFrontier =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website/setupFrontier,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** setupFrontier 18 Feb 2006 18:53:07 -0000 1.7 --- setupFrontier 10 Mar 2006 22:01:14 -0000 1.8 *************** *** 1,3 **** ! FrontierVcsFile:1:scpt:mainResponder.adminSite.website.setupFrontier ! on setupFrontier () { ÇChanges Ç2/18/06; 9:55:55 AM by TAC Çadded programName to personalize webpage and pop window Ç2/8/06; 2:20:15 PM by TAC Çlowercase method get, towards XHTML compliance Ç2/1/06; 1:32:48 PM by TAC Çtowards XHTML compliance Çlowercase method check, towards XHTML compliance Ç7/6/05; 12:51:01 PM by TAC Çrewrite, based on old code <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website/setupFrontier?rev=1.2> local (pta = html.getPageTableAddress ()); local (errorMessage = "", htmlText = "", indentLevel = 0, pathArgs = ""); on add (s) { htmlText = htmlText + string.filledstring ("\t", indentLevel) + s + "\r"}; on popupWindowLink (label, localizationStringId) { localizationStringId = string.urlEncode (localizationStringId); return ("<a href=\"JavaScript: newWindow=openWin ('" + string.popLeading (pta^.URI, '/') + "$popupWindow?label=" + string.urlEncode (label) + "&localizationStringId=" + localizationStringId + "', 'prefsPopup', 'width=400,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'); newWindow.focus ()\">" + label + "</a>")}; if string.lower (pta^.method) == "post" { local (adrArgs = @pta^.postArgs, flError = false); if defined (adrArgs^.personalize) { // personalize local (name = adrArgs^.name); local (organization = adrArgs^.organization); local (email = adrArgs^.email); local (mailHost = adrArgs^.mailHost); local (password = adrArgs^.password); local (repeat = adrArgs^.repeatPassword); bundle { // convert mail host port to a number try { // if not, it's an error adrArgs^.mailHostPort = number (adrArgs^.mailHostPort)} else { errorMessage = "Can't set the outgoing mail server port because the port you entered is not valid."; flError = true}}; bundle { // convert web server port to a number try { // if not, it's an error adrArgs^.webServerPort = number (adrArgs^.webServerPort)} else { errorMessage = "Can't set the web server port because the port you entered is not valid."; flError = true}}; on getInitials (s) { local (initials = ""); bundle { //strip off parentheticals if s contains "(" { s = string.nthField (s, "(", 1)}; if s contains "[" { s = string.nthField (s, "[", 1)}; if s contains "{" { s = string.nthField (s, "{", 1)}}; s = string.trimWhiteSpace (s); initials = string.upper (s[1]); local (i, ct = sizeOf (s)); if sizeOf (s) > 1 { local (flNextCharIsInitial = false); for i = 2 to ct { if flNextCharIsInitial { if string.isAlpha (s[i]) { initials = initials + string.upper (s[i])}; flNextCharIsInitial = false}; if not string.isAlpha (s[i]) { flNextCharIsInitial = true}}}; return (initials)}; on setName (name) { user.prefs.name = name; bundle { //set user.prefs.initials user.prefs.initials = getInitials (name)}}; on setEmail (email) { user.prefs.mailAddress = email}; if system.environment.isMac { //convert name, organization to Mac text name = latinToMac.convert (name); organization = latinToMac.convert (organization)}; setName (name); setEmail (email); user.prefs.organization = organization; user.prefs.mailHost = mailHost; config.mainResponder.prefs.baseUrl = "http://" + adrArgs^.webServerDomain + "/"; bundle { //check that the password is ok, and that it matches the repeat password if sizeOf (password) < 4 { errorMessage = "Can't continue setting up Frontier because the password you supplied is not at least four characters long."; flError = true}; if not flError { if password != repeat { errorMessage = "Can't continue setting up Frontier because the password you supplied does not match the repeat password."; flError = true}}}; bundle { //set up Admin member for access to control panel bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); if not defined (adrMember^) { new (tableType, adrMember)}; adrMember^.password = password; if not defined (adrMember^.personalInfo) { new (tableType, @adrMember^.personalInfo)}; if not defined (adrMember^.personalInfo.name) { adrMember^.personalInfo.name = user.prefs.name}}; if not (flError) { user.prefs.mailHostPort = adrArgs^.mailHostPort; if adrArgs^.webServerPort != user.inetd.config.http.port { // web server port local (flRunning = inetd.isDaemonRunning (@user.inetd.config.http)); if flRunning { //stop server, set port, restart server inetd.stopOne (@user.inetd.config.http); user.inetd.config.http.port = adrArgs^.webServerPort; inetd.startOne (@user.inetd.config.http)} else { //just set port user.inetd.config.http.port = adrArgs^.webServerPort}}; scriptError ("!redirect " + pta^.URI + "$proxyServer")}}; if defined (adrArgs^.proxyServer) { // proxy server try { // convert port to a number -- if not, it's an error adrArgs^.port = number (adrArgs^.port)} else { errorMessage = "Can't set your proxy server settings because the port you entered is not valid."; adrArgs^.enabled = false; flError = true}; user.webBrowser.proxy.domain = adrArgs^.domain; user.webBrowser.proxy.username = adrArgs^.username; user.webBrowser.proxy.password = binary (adrArgs^.password); user.webBrowser.proxy.enabled = false; if defined (adrArgs^.enabled) { if adrArgs^.enabled { user.webBrowser.proxy.enabled = true}}; if not (flError) { user.webBrowser.proxy.port = adrArgs^.port; scriptError ("!redirect " + pta^.URI + "$portForwarding")}}; if defined (adrArgs^.portForwarding) { // port forwarding local (adminPassword = adrArgs^.password); local (flEnablePortForwarding = defined (adrArgs^.flEnablePortForwarding)); local (flRememberAdminPassword = defined (adrArgs^.flRememberAdminPassword)); local (password = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)^.password); local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); bundle { // convert actualPort to a number -- if not, it's an error try { adrArgs^.actualPort = number (adrArgs^.actualPort)} else { errorMessage = "Can't set your actual web server port because the port you entered is not valid."; flEnablePortForwarding = false; flError = true}}; bundle { // convert apparentPort to a number -- if not, it's an error try { adrArgs^.apparentPort = number (adrArgs^.apparentPort)} else { errorMessage = "Can't set your apparent web server port because the port you entered is not valid."; flEnablePortForwarding = false; flError = true}}; if flRememberAdminPassword and flEnablePortForwarding { user.prefs.portForwardingAdminPassword = binary (adminPassword)}; if not (flError) { if adrArgs^.actualPort != user.inetd.config.http.port or adrArgs^.apparentPort != user.inetd.config.http.apparentPort { local (flRunning = inetd.isDaemonRunning (@user.inetd.config.http)); if flRunning { // stop server, set port, restart server inetd.stopOne (@user.inetd.config.http); user.inetd.config.http.apparentPort = adrArgs^.apparentPort; user.inetd.config.http.port = adrArgs^.actualPort; inetd.startOne (@user.inetd.config.http)} else { // just set port user.inetd.config.http.apparentPort = adrArgs^.apparentPort; user.inetd.config.http.port = adrArgs^.actualPort}}}; Frontier.completeSetup (urlParts [2], password, adminPassword, flRememberAdminPassword, flEnablePortForwarding); if not (flError) { scriptError ("!redirect " + pta^.URI + "$congratulations")}}}; if defined (pta^.pathArgs) { if pta^.pathArgs != "" { pathArgs = pta^.pathArgs}}; case pathArgs { // generally the cases should be ordered in user presentation order, they can be accessed by name or number, name is preferred "1"; "personalize" { local (name = user.prefs.name, organization = user.prefs.organization); pta^.title = "Personalize"; bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; if system.environment.isMac { // convert name, organization to latin text name = latinToMac.macToLatin (name); organization = latinToMac.macToLatin (organization)}; bundle { //render the new user page local (t); new (tabletype, @t); bundle { // add the labels to the replacement table t.userPasswordLabel = popupWindowLink (Frontier.getProgramName (false) + " Admin password", "setupFrontier.popupText.adminPassword"); t.webserverdomainlabel = popupWindowLink ("Web server domain name or IP address", "setupFrontier.popupText.webServerDomainIp")}; bundle { // add personal info to replacement table t.mailhost = user.prefs.mailHost; t.mailHostPort = user.prefs.mailHostPort; t.programName = Frontier.getProgramName (false); t.useremail = user.prefs.mailAddress; t.username = name; t.userorganization = organization; t.userpassword = ""; bundle { // web server domain or ip address local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); t.webserverdomain = urlParts [2]}; try { // try to get the admin password from the Admin membership group local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); if defined (adrMember^) { t.userpassword = adrMember^.password}}; bundle { // web server port t.webserverport = user.inetd.config.http.port}}; bundle { // add error message to replacement table t.errorMessage = ""; if errorMessage != "" { t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; add (mainResponder.getString ("setupFrontier.personalize", @t))}}; "2"; "proxyServer" { pta^.title = "Proxy Server Settings"; bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; bundle { // render the new user page local (t); new (tabletype, @t); bundle { // add proxy settings to replacement table with user.webBrowser.proxy { t.proxydomain = domain; t.proxyusername = username; t.proxypassword = string (password); t.proxyport = port; if enabled { t.proxyenabled = "checked"} else { t.proxyenabled = ""}}}; bundle { // add error message to replacement table t.errorMessage = ""; if errorMessage != "" { t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; add (mainResponder.getString ("setupFrontier.proxyServer", @t))}}; "3"; "portForwarding" { if system.environment.isCarbon { //we need to run the port forwarding page now pta^.title = "Mac OS X Port Forwarding"; bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; bundle { // render the new user page local (t); new (tabletype, @t); t.adminPassword = ""; t.rememberAdminPassword = "checked"; t.enablePortForwarding = "checked"; t.actualPort = user.inetd.config.http.port; t.apparentPort = 80; if defined (user.inetd.config.http.apparentPort) { t.apparentPort = user.inetd.config.http.apparentPort}; if defined (user.prefs.portForwardingAdminPassword) { t.adminPassword = string (user.prefs.portForwardingAdminPassword)}; bundle { // add error message to replacement table t.errorMessage = ""; if errorMessage != "" { t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; add (mainResponder.getString ("setupFrontier.portForwarding", @t))}} else { //Windows and Classic don't need to deal with port forwarding local (password = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)^.password); local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); Frontier.completeSetup (urlParts [2], password); scriptError ("!redirect " + pta^.URI + "$congratulations")}}; "4"; "congratulations" { bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; pta^.title = "Congratulations"; local (adminSiteUrl = "http://" + pta^.host + "/"); bundle { //render the new user page add (mainResponder.getString ("setupFrontier.newUserConfirmMessage")); bundle { //add the Continue button local (adminSiteUrl = "http://" + pta^.host + "/"); add ("<form method=\"get\" action=\"" + adminSiteUrl + "\">"); add ("<input type=\"submit\" value=\"Continue\" onclick=\"document.location='" + adminSiteUrl + "'\" />"); add ("</form>")}; if defined (system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage) { system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = false}}}; //require login from now on "popupWindow" { // this is a special case, it produces a popup window local (t); new (tableType, @t); t.programName = Frontier.getProgramName (false); pta^.autoParagraphs = true; pta^.title = "Popup Text"; table.assign (@pta^.pageHeader, "<html><head><title><%title%></title></head><body>"); table.assign (@pta^.template, "<body>{bodytext}</body></html>"); try { delete (@pta^.javaScript)}; // popup windows should not have any JavaScript add ("<div name=\"setupfrontierpopupwindow\" style=\"font-size: x-large; margin: 13px;\">"); indentLevel++; add ("<b>"); indentLevel++; add (string.urlDecode (pta^.searchArgTable.label)); add ("</b>"); indentLevel--; add ("<br />"); add ("<br />"); add (mainResponder.getString (pta^.searchArgTable.localizationStringId, @t)); add ("</div>"); indentLevel--}} else { scriptError ("!redirect " + pta^.URI + "$personalize")}; return (htmlText)} \ No newline at end of file --- 1,425 ---- ! FrontierVcsFile:2:scpt:mainResponder.adminSite.website.setupFrontier ! on setupFrontier () { ! «Changes ! «3/6/06; 7:50:35 PM by TAC ! «added local programName ! «added support for settings for using SMTP AUTH ! «2/28/06; 11:21:17 AM by TAC ! «replace extensions.latinToMac.convert with string.latinToMac ! «replace extensions.latinToMac.macToLatin with string.macToLatin ! «2/18/06; 9:55:55 AM by TAC ! «added programName to personalize webpage and pop window ! «2/8/06; 2:20:15 PM by TAC ! «lowercase method get, towards XHTML compliance ! «2/1/06; 1:32:48 PM by TAC ! «towards XHTML compliance ! «lowercase method check, towards XHTML compliance ! «7/6/05; 12:51:01 PM by TAC ! «rewrite, based on old code <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website/setupFrontier?rev=1.2> ! ! local (pta = html.getPageTableAddress ()); ! local (errorMessage = "", htmlText = "", indentLevel = 0, pathArgs = "", programName = Frontier.getProgramName (false)); ! ! on add (s) { ! htmlText = htmlText + string.filledstring ("\t", indentLevel) + s + "\r"}; ! ! on popupWindowLink (label, localizationStringId) { ! localizationStringId = string.urlEncode (localizationStringId); ! return ("<a href=\"JavaScript: newWindow=openWin ('" + string.popLeading (pta^.URI, '/') + "$popupWindow?label=" + string.urlEncode (label) + "&localizationStringId=" + localizationStringId + "', 'prefsPopup', 'width=400,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'); newWindow.focus ()\">" + label + "</a>")}; ! ! if string.lower (pta^.method) == "post" { ! local (adrArgs = @pta^.postArgs, flError = false); ! ! if defined (adrArgs^.personalize) { // personalize ! local (name = adrArgs^.name); ! local (organization = adrArgs^.organization); ! local (email = adrArgs^.email); ! local (emailPassword = adrArgs^.emailPassword); ! local (repeatEmailPassword = adrArgs^.repeatEmailPassword); ! local (mailHost = adrArgs^.mailHost); ! local (smtpAuth = adrArgs^.smtpAuth); ! local (password = adrArgs^.password); ! local (repeat = adrArgs^.repeatPassword); ! ! bundle { // convert mail host port to a number ! try { // if not, it's an error ! adrArgs^.mailHostPort = number (adrArgs^.mailHostPort)} ! else { ! errorMessage = "Can't set the outgoing mail server port because the port you entered is not valid."; ! flError = true}}; ! ! bundle { // convert web server port to a number ! try { // if not, it's an error ! adrArgs^.webServerPort = number (adrArgs^.webServerPort)} ! else { ! errorMessage = "Can't set the web server port because the port you entered is not valid."; ! flError = true}}; ! ! on getInitials (s) { ! local (initials = ""); ! ! bundle { //strip off parentheticals ! if s contains "(" { ! s = string.nthField (s, "(", 1)}; ! if s contains "[" { ! s = string.nthField (s, "[", 1)}; ! if s contains "{" { ! s = string.nthField (s, "{", 1)}}; ! ! s = string.trimWhiteSpace (s); ! initials = string.upper (s[1]); ! ! local (i, ct = sizeOf (s)); ! ! if sizeOf (s) > 1 { ! local (flNextCharIsInitial = false); ! ! for i = 2 to ct { ! if flNextCharIsInitial { ! if string.isAlpha (s[i]) { ! initials = initials + string.upper (s[i])}; ! flNextCharIsInitial = false}; ! if not string.isAlpha (s[i]) { ! flNextCharIsInitial = true}}}; ! return (initials)}; ! ! on setName (name) { ! user.prefs.name = name; ! ! bundle { //set user.prefs.initials ! user.prefs.initials = getInitials (name)}}; ! ! on setEmail (email) { ! user.prefs.mailAddress = email}; ! ! if system.environment.isMac { //convert name, organization to Mac text ! name = string.latinToMac (name); ! organization = string.latinToMac (organization)}; ! ! setName (name); ! setEmail (email); ! ! config.mainResponder.prefs.baseUrl = "http://" + adrArgs^.webServerDomain + "/"; ! user.prefs.organization = organization; ! user.prefs.mailHost = mailHost; ! user.prefs.mailSmtpAuth = smtpAuth; ! ! bundle { // check that the email password is ok, and that it matches the repeat password ! «if sizeOf (emailPassword) < 4 ! «errorMessage = "Can't continue setting up Frontier because the email password you supplied is not at least four characters long." ! «flError = true ! ! «if not (flError) ! if emailPassword != repeatEmailPassword { ! errorMessage = "Can't continue setting up " + programName + " because the email password you supplied does not match the repeat email password."; ! flError = true}}; ! ! bundle { //check that the password is ok, and that it matches the repeat password ! if not (flError) { ! if sizeOf (password) < 4 { ! errorMessage = "Can't continue setting up Frontier because the password you supplied is not at least four characters long."; ! flError = true}; ! ! if not (flError) { ! if password != repeat { ! errorMessage = "Can't continue setting up Frontier because the password you supplied does not match the repeat password."; ! flError = true}}}}; ! ! if not (flError) { ! user.prefs.mailHostPort = adrArgs^.mailHostPort; ! ! bundle { //set up Admin member for access to control panel ! bundle { //create the Admin membership group if needed ! local (adrRoot = @[system.temp.mainResponder.membersRootFile]); ! local (adrGroup = @adrRoot^.admin); ! if not defined (adrGroup^) { ! new (tableType, adrGroup)}; ! if not defined (adrGroup^.callbacks) { ! new (tableType, @adrGroup^.callbacks)}; ! if not defined (adrGroup^.cookieDomain) { ! adrGroup^.cookieDomain = ""}; ! if not defined (adrGroup^.cookieExpires) { ! adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; ! if not defined (adrGroup^.cookieName) { ! adrGroup^.cookieName = "Admin"}; ! if not defined (adrGroup^.mailReturnAddress) { ! adrGroup^.mailReturnAddress = user.prefs.mailAddress}; ! if not defined (adrGroup^.mailSubject) { ! adrGroup^.mailSubject = "Admin"}; ! if not defined (adrGroup^.mailTemplate) { ! wp.newTextObject ("", @adrGroup^.mailTemplate)}; ! if not defined (adrGroup^.openToPublic) { ! adrGroup^.openToPublic = false}; ! if not defined (adrGroup^.users) { ! new (tableType, @adrGroup^.users)}}; ! ! local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); ! ! if not defined (adrMember^) { ! new (tableType, adrMember)}; ! ! adrMember^.password = password; ! ! if not defined (adrMember^.personalInfo) { ! new (tableType, @adrMember^.personalInfo)}; ! ! if not defined (adrMember^.personalInfo.name) { ! adrMember^.personalInfo.name = user.prefs.name}}; ! ! bundle { // email password ! if emailPassword != "" { ! emailPassword = binary (emailPassword)}; ! ! user.prefs.mailPassword = emailPassword}; ! ! if adrArgs^.webServerPort != user.inetd.config.http.port { // web server port ! local (flRunning = inetd.isDaemonRunning (@user.inetd.config.http)); ! ! if flRunning { //stop server, set port, restart server ! inetd.stopOne (@user.inetd.config.http); ! user.inetd.config.http.port = adrArgs^.webServerPort; ! inetd.startOne (@user.inetd.config.http)} ! else { //just set port ! user.inetd.config.http.port = adrArgs^.webServerPort}}; ! ! scriptError ("!redirect " + pta^.URI + "$proxyServer")}}; ! ! if defined (adrArgs^.proxyServer) { // proxy server ! try { // convert port to a number -- if not, it's an error ! adrArgs^.port = number (adrArgs^.port)} ! else { ! errorMessage = "Can't set your proxy server settings because the port you entered is not valid."; ! adrArgs^.enabled = false; ! flError = true}; ! user.webBrowser.proxy.domain = adrArgs^.domain; ! user.webBrowser.proxy.username = adrArgs^.username; ! user.webBrowser.proxy.password = binary (adrArgs^.password); ! user.webBrowser.proxy.enabled = false; ! if defined (adrArgs^.enabled) { ! if adrArgs^.enabled { ! user.webBrowser.proxy.enabled = true}}; ! if not (flError) { ! user.webBrowser.proxy.port = adrArgs^.port; ! scriptError ("!redirect " + pta^.URI + "$portForwarding")}}; ! ! if defined (adrArgs^.portForwarding) { // port forwarding ! local (adminPassword = adrArgs^.password); ! local (flEnablePortForwarding = defined (adrArgs^.flEnablePortForwarding)); ! local (flRememberAdminPassword = defined (adrArgs^.flRememberAdminPassword)); ! local (password = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)^.password); ! local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); ! bundle { // convert actualPort to a number -- if not, it's an error ! try { ! adrArgs^.actualPort = number (adrArgs^.actualPort)} ! else { ! errorMessage = "Can't set your actual web server port because the port you entered is not valid."; ! flEnablePortForwarding = false; ! flError = true}}; ! bundle { // convert apparentPort to a number -- if not, it's an error ! try { ! adrArgs^.apparentPort = number (adrArgs^.apparentPort)} ! else { ! errorMessage = "Can't set your apparent web server port because the port you entered is not valid."; ! flEnablePortForwarding = false; ! flError = true}}; ! if flRememberAdminPassword and flEnablePortForwarding { ! user.prefs.portForwardingAdminPassword = binary (adminPassword)}; ! if not (flError) { ! if adrArgs^.actualPort != user.inetd.config.http.port or adrArgs^.apparentPort != user.inetd.config.http.apparentPort { ! local (flRunning = inetd.isDaemonRunning (@user.inetd.config.http)); ! if flRunning { // stop server, set port, restart server ! inetd.stopOne (@user.inetd.config.http); ! user.inetd.config.http.apparentPort = adrArgs^.apparentPort; ! user.inetd.config.http.port = adrArgs^.actualPort; ! inetd.startOne (@user.inetd.config.http)} ! else { // just set port ! user.inetd.config.http.apparentPort = adrArgs^.apparentPort; ! user.inetd.config.http.port = adrArgs^.actualPort}}}; ! Frontier.completeSetup (urlParts [2], password, adminPassword, flRememberAdminPassword, flEnablePortForwarding); ! if not (flError) { ! scriptError ("!redirect " + pta^.URI + "$congratulations")}}}; ! ! if defined (pta^.pathArgs) { ! if pta^.pathArgs != "" { ! pathArgs = pta^.pathArgs}}; ! ! case pathArgs { // generally the cases should be ordered in user presentation order, they can be accessed by name or number, name is preferred ! "1"; ! "personalize" { ! local (name = user.prefs.name, organization = user.prefs.organization); ! ! pta^.title = "Personalize"; ! ! bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site ! table.assign (@pta^.template, "setup"); ! pta^.indirectTemplate = true}; ! ! if system.environment.isMac { // convert name, organization to latin text ! name = string.macToLatin (name); ! organization = string.macToLatin (organization)}; ! ! bundle { //render the new user page ! local (t); new (tabletype, @t); ! ! bundle { // add the labels to the replacement table ! t.emailPasswordLabel = popupWindowLink ("Email password", "setupFrontier.popupText.emailPassword"); ! t.userPasswordLabel = popupWindowLink (programName + " Admin password", "setupFrontier.popupText.adminPassword"); ! t.webserverdomainlabel = popupWindowLink ("Web server domain name or IP address", "setupFrontier.popupText.webServerDomainIp")}; ! ! bundle { // add personal info to replacement table ! t.mailhost = user.prefs.mailHost; ! t.mailHostPort = user.prefs.mailHostPort; ! t.programName = programName; ! t.useremail = user.prefs.mailAddress; ! t.emailPassword = ""; ! t.username = name; ! t.userorganization = organization; ! t.userpassword = ""; ! ! try { // try to get user email password ! t.emailPassword = string (user.prefs.mailPassword)}; ! ! try { // try to get the admin password from the Admin membership group ! local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); ! ! if defined (adrMember^) { ! t.userpassword = adrMember^.password}}; ! ! bundle { // web server domain or ip address ! local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); ! t.webserverdomain = urlParts [2]}; ! ! bundle { // web server port ! t.webserverport = user.inetd.config.http.port}; ! ! bundle { // smtp auth ! local (item, s, smtpAuthMethods = {"", "CRAM-MD5", "LOGIN", "PLAIN"}); ! ! s = "<select name=\"smtpAuth\">\r"; ! ! for item in smtpAuthMethods { ! s = s + "<option"; ! ! if item == user.prefs.mailSmtpAuth { ! s = s + " selected"}; ! ! s = s + " value=\"" + item + "\">\r"; ! ! if item == "" { ! item = "NONE"}; ! ! s = s + item + "\r"; ! s = s + "</option>\r"}; ! ! s = s + "</select>\r"; ! t.smtpAuth = s}; ! }; ! bundle { // add error message to replacement table ! t.errorMessage = ""; ! if errorMessage != "" { ! t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; ! ! add (mainResponder.getString ("setupFrontier.personalize", @t))}}; ! "2"; ! "proxyServer" { ! pta^.title = "Proxy Server Settings"; ! bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site ! table.assign (@pta^.template, "setup"); ! pta^.indirectTemplate = true}; ! ! bundle { // render the new user page ! local (t); new (tabletype, @t); ! bundle { // add proxy settings to replacement table ! with user.webBrowser.proxy { ! t.proxydomain = domain; ! t.proxyusername = username; ! t.proxypassword = string (password); ! t.proxyport = port; ! if enabled { ! t.proxyenabled = "checked"} ! else { ! t.proxyenabled = ""}}}; ! bundle { // add error message to replacement table ! t.errorMessage = ""; ! if errorMessage != "" { ! t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; ! add (mainResponder.getString ("setupFrontier.proxyServer", @t))}}; ! "3"; ! "portForwarding" { ! if system.environment.isCarbon { //we need to run the port forwarding page now ! pta^.title = "Mac OS X Port Forwarding"; ! bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site ! table.assign (@pta^.template, "setup"); ! pta^.indirectTemplate = true}; ! ! bundle { // render the new user page ! local (t); new (tabletype, @t); ! t.adminPassword = ""; ! t.rememberAdminPassword = "checked"; ! t.enablePortForwarding = "checked"; ! t.actualPort = user.inetd.config.http.port; ! t.apparentPort = 80; ! if defined (user.inetd.config.http.apparentPort) { ! t.apparentPort = user.inetd.config.http.apparentPort}; ! if defined (user.prefs.portForwardingAdminPassword) { ! t.adminPassword = string (user.prefs.portForwardingAdminPassword)}; ! bundle { // add error message to replacement table ! t.errorMessage = ""; ! if errorMessage != "" { ! t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; ! add (mainResponder.getString ("setupFrontier.portForwarding", @t))}} ! else { //Windows and Classic don't need to deal with port forwarding ! local (password = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)^.password); ! local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); ! Frontier.completeSetup (urlParts [2], password); ! scriptError ("!redirect " + pta^.URI + "$congratulations")}}; ! "4"; ! "congratulations" { ! bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site ! table.assign (@pta^.template, "setup"); ! pta^.indirectTemplate = true}; ! ! pta^.title = "Congratulations"; ! ! local (adminSiteUrl = "http://" + pta^.host + "/"); ! ! bundle { //render the new user page ! add (mainResponder.getString ("setupFrontier.newUserConfirmMessage")); ! bundle { //add the Continue button ! local (adminSiteUrl = "http://" + pta^.host + "/"); ! ! add ("<form method=\"get\" action=\"" + adminSiteUrl + "\">"); ! add ("<input type=\"submit\" value=\"Continue\" onclick=\"document.location='" + adminSiteUrl + "'\" />"); ! add ("</form>")}; ! ! if defined (system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage) { ! system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = false}}}; //require login from now on ! "popupWindow" { // this is a special case, it produces a popup window ! local (t); ! ! new (tableType, @t); ! ! t.programName = programName; ! ! pta^.autoParagraphs = true; ! pta^.title = "Popup Text"; ! ! table.assign (@pta^.pageHeader, "<html><head><title><%title%></title></head><body>"); ! table.assign (@pta^.template, "<body>{bodytext}</body></html>"); ! ! try { ! delete (@pta^.javaScript)}; // popup windows should not have any JavaScript ! ! add ("<div name=\"setupfrontierpopupwindow\" style=\"font-size: x-large; margin: 13px;\">"); indentLevel++; ! add ("<b>"); indentLevel++; ! add (string.urlDecode (pta^.searchArgTable.label)); ! add ("</b>"); indentLevel--; ! add ("<br />"); ! add ("<br />"); ! add (mainResponder.getString (pta^.searchArgTable.localizationStringId, @t)); ! add ("</div>"); indentLevel--}} ! else { ! scriptError ("!redirect " + pta^.URI + "$personalize")}; ! ! return (htmlText)} \ No newline at end of file |
|
From: creecode <icr...@us...> - 2006-03-10 22:00:33
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/localization/languages/english/strings/setupFrontier/popupText In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21327 Added Files: emailPassword Log Message: popup text for email password on setup webpage --- NEW FILE: emailPassword --- FrontierVcsFile:2:TEXT:mainResponder.localization.languages.english.strings.setupFrontier.popupText.emailPassword The password entered in this field, along with the email address you entered, can be used for sending email via an SMTP mail server that requires you to be authenticated to send email. |
|
From: creecode <icr...@us...> - 2006-03-10 22:00:18
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/localization/languages/english/strings/setupFrontier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20932 Modified Files: personalize Log Message: popup text for email password on setup webpage Index: personalize =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/localization/languages/english/strings/setupFrontier/personalize,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** personalize 18 Feb 2006 18:53:02 -0000 1.4 --- personalize 10 Mar 2006 22:00:01 -0000 1.5 *************** *** 1,3 **** ! FrontierVcsFile:1:optx:mainResponder.localization.languages.english.strings.setupFrontier.personalize ! [[errorMessage]] <p> There are just a few more easy steps -- to personalize this copy of [[programName]], configure your network settings, and complete the installation. <br /> <br /> Some of the form field labels are links which will bring up a popup text window with more detail about that field. <br /> <br /> You will use the email address you enter below, later in the installation process, when you are asked to login to the [[programName]] Admin web site. </p> <form method="post"> <table border="0" cellspacing="1" cellpadding="5"> <tr> <td align="left">Name:</td> <td valign="top" colspan="1"><input type="text" name="name" size="50" maxlength="255" value="[[username]]" /></td> </tr> <tr> <td align="left">Organization:</td> <td valign="top" colspan="1"><input type="text" name="organization" size="50" maxlength="255" value="[[userorganization]]" /></td> </tr> <tr> <td align="left">Email address: </td> <td valign="top" colspan="1"><input type="text" name="email" size="50" maxlength="255" value="[[useremail]]" /></td> </tr> <tr> <td align="left">Outgoing (SMTP) mail server:</td> <td valign="top" colspan="1"><input type="text" name="mailHost" size="50" maxlength="255" value="[[mailhost]]" /></td> </tr> <tr> <td align="left"> Outgoing (SMTP) mail server port: </td> <td valign="top" colspan="1"> <input type="text" name="mailHostPort" size="50" maxlength="255" value="[[mailHostPort]]" /> </td> </tr> <tr> <td align="left"> [[webserverdomainlabel]]: </td> <td valign="top" colspan="1"><input type="text" name="webServerDomain" size="50" maxlength="255" value="[[webserverdomain]]" /></td> </tr> <tr> <td align="left">Web server port: </td> <td valign="top" colspan="1"><input type="text" name="webServerPort" size="50" maxlength="255" value="[[webserverport]]" /></td> </tr> <tr> <td align="left"> [[userPasswordLabel]]: </td> <td valign="top" colspan="1"> <input type="password" name="password" size="25" maxlength="255" value="[[userpassword]]" /> </td> </tr> <tr> <td align="left"> Repeat password: </td> <td valign="top" colspan="1"> <input type="password" name="repeatPassword" size="25" maxlength="255" value="[[userpassword]]" /> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="personalize" value="Submit" /> </td> </tr> </table> </form> \ No newline at end of file --- 1,101 ---- ! FrontierVcsFile:2:optx:mainResponder.localization.languages.english.strings.setupFrontier.personalize ! [[errorMessage]] ! <p> ! There are just a few more easy steps -- to personalize this copy of [[programName]], configure your network settings, and complete the installation. ! <br /> ! <br /> ! Some of the form field labels are links which will bring up a popup text window with more detail about that field. ! <br /> ! <br /> ! You will use the email address you enter below, later in the installation process, when you are asked to login to the [[programName]] Admin web site. ! </p> ! <form method="post"> ! <table border="0" cellspacing="1" cellpadding="5"> ! <tr> ! <td align="left">Name:</td> ! <td valign="top" colspan="1"><input type="text" name="name" size="50" maxlength="255" value="[[username]]" /></td> ! </tr> ! <tr> ! <td align="left">Organization:</td> ! <td valign="top" colspan="1"><input type="text" name="organization" size="50" maxlength="255" value="[[userorganization]]" /></td> ! </tr> ! <tr> ! <td align="left">Email address: </td> ! <td valign="top" colspan="1"><input type="text" name="email" size="50" maxlength="255" value="[[useremail]]" /></td> ! </tr> ! <tr> ! <td align="left"> ! [[emailPasswordLabel]]: ! </td> ! <td valign="top" colspan="1"> ! <input type="password" name="emailPassword" size="25" maxlength="255" value="[[emailPassword]]" /> ! </td> ! </tr> ! <tr> ! <td align="left"> ! Repeat email password: ! </td> ! <td valign="top" colspan="1"> ! <input type="password" name="repeatEmailPassword" size="25" maxlength="255" value="[[emailPassword]]" /> ! </td> ! </tr> ! <tr> ! <td align="left">Outgoing (SMTP) mail server:</td> ! <td valign="top" colspan="1"><input type="text" name="mailHost" size="50" maxlength="255" value="[[mailhost]]" /></td> ! </tr> ! <tr> ! <td align="left"> ! Outgoing (SMTP or SMTP Submit) ! <br /> ! mail server port: ! </td> ! <td valign="top" colspan="1"> ! <input type="text" name="mailHostPort" size="50" maxlength="255" value="[[mailHostPort]]" /> ! </td> ! </tr> ! <tr> ! <td align="left"> ! Outgoing (SMTP) mail server ! <br /> ! authentication method: ! </td> ! <td valign="top" colspan="1"> ! [[smtpAuth]] ! </td> ! </tr> ! <tr> ! <td align="left"> ! [[webserverdomainlabel]]: ! </td> ! <td valign="top" colspan="1"><input type="text" name="webServerDomain" size="50" maxlength="255" value="[[webserverdomain]]" /></td> ! </tr> ! <tr> ! <td align="left">Web server port: </td> ! <td valign="top" colspan="1"><input type="text" name="webServerPort" size="50" maxlength="255" value="[[webserverport]]" /></td> ! </tr> ! <tr> ! <td align="left"> ! [[userPasswordLabel]]: ! </td> ! <td valign="top" colspan="1"> ! <input type="password" name="password" size="25" maxlength="255" value="[[userpassword]]" /> ! </td> ! </tr> ! <tr> ! <td align="left"> ! Repeat Frontier Admin password: ! </td> ! <td valign="top" colspan="1"> ! <input type="password" name="repeatPassword" size="25" maxlength="255" value="[[userpassword]]" /> ! </td> ! </tr> ! <tr> ! <td> ! </td> ! <td> ! <input type="submit" name="personalize" value="Submit" /> ! </td> ! </tr> ! </table> ! </form> |
|
From: creecode <icr...@us...> - 2006-03-10 21:46:45
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12025 Modified Files: sendMail Log Message: added support for STMP AUTH using CRAM-MD5, LOGIN, and PLAIN use Frontier.getProgramName for X-Mailer Index: sendMail =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/tcp/sendMail,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sendMail 6 Jul 2005 19:25:03 -0000 1.2 --- sendMail 10 Mar 2006 21:46:41 -0000 1.3 *************** *** 1,3 **** ! FrontierVcsFile:1:scpt:system.verbs.builtins.tcp.sendMail ! on sendMail (recipient="", subject="", message="", sender=user.prefs.mailAddress, cc="", bcc="", host=user.prefs.mailHost, mimeType="text/plain", adrHdrTable=nil, timeOutTicks=60*60, flMessages=true, port = user.prefs.mailHostPort) { ÇChanges Ç7/5/05; 8:57:26 AM by TAC Çremoved Userland from X-Mailer Çadded port parameter Ç11/05/1999 at 12:57:30 AM by AR ÇUpdated to use 6.1 TCP verbs. ÇCleaned up low-level error messages to conform to "Can't do x because y" scheme. Ç7/25/99; 8:04:26 AM by DW ÇLoop over scripts in user.callbacks.sendmail table. ÇWed, 16 Jun 1999 00:05:16 GMT by AR ÇAdded optional adrHdrTable parameter, the address of a table. If an address is specified, its fields are added to the message header, possibly overriding standard header items. ÇAdded optional timeOutTicks parameter. The default value is 3600 ticks (60 seconds). If the connection is idle for more than the specified number of ticks while waiting for a response from the server, the connection is closed and an error message is generated. ÇAdded optional flMessages parameter. If it is true (the default), status messages will be displayed in Frontier's About window. The displayed messages are prefixed with the name of this script. Before we return, we clean up the message area. ÇAdded extensive error checking and reporting code. If the script returns true, it is now safe to assume that the message was accepted by the server. Status messages received from the server indicating that an error has occured are no longer ignored. Whenever an error occurs, we try to shut down the connection gracefully before throwing a scripterror. ÇCalls to thread.sleepFor were added to the TCP read/write loops for improved thread-friendliness. bundle { //loop over callbacks if defined (user.callbacks.tcpSendMail) { local (i); for i = 1 to sizeof (user.callbacks.tcpSendMail) { try { local (adrcallback = @user.callbacks.tcpSendMail [i]); if typeof (adrcallback^) == scriptType { //avoid problems with item #1s if adrcallback^ (recipient, subject, message, sender, cc, bcc, mimetype) { Çcallback returns true if it consumed the sendMail operation return (true)}}}}}}; on displayMsg (s) { msg ("tcp.sendMail: " + s)}; local (buffer = "", response = ""); on add (s) { //appends crlf delimited items to our message buffer buffer = buffer + s + cr + lf}; bundle { //build the header and store in buffer local (addedFromTableList = {}); on addFromHeaderTable (s) { if (adrHdrTable != nil) and defined (adrHdrTable^.[s]) { add (nameOf (adrHdrTable^.[s]) + ": " + adrHdrTable^.[s]); addedFromTableList = addedFromTableList + string.lower (s); return (true)}; return (false)}; if not addFromHeaderTable ("X-Mailer") { add ("X-Mailer: " + "Frontier " + Frontier.version () + " (" + sys.osName () + ")")}; if not addFromHeaderTable ("Mime-Version") { add ("Mime-Version: 1.0")}; if not addFromHeaderTable ("Content-Type") { add ("Content-Type: " + mimeType + "; charset=\"us-ascii\"")}; if not addFromHeaderTable ("Date") { add ("Date: " + date.netStandardString (clock.now ()))}; if not addFromHeaderTable ("To") { if sizeOf (recipient) > 0 { add ("To: " + recipient)}}; if not addFromHeaderTable ("CC") { if sizeOf (cc) > 0 { add ("CC: " + cc)}}; if not addFromHeaderTable ("From") { add ("From: " + sender)}; if not addFromHeaderTable ("Subject") { add ("Subject: " + subject)}; if adrHdrTable != nil { //now add remaining header fields from the table local (i); for i = 1 to sizeOf (adrHdrTable^) { if not (addedFromTableList contains string.lower (nameOf (adrHdrTable^ [i]))) { add (nameOf (adrHdrTable^ [i]) + ": " + adrHdrTable^ [i])}}}; add ("")}; //a blank line before the content is required! bundle { //build message body and store in buffer if not (message contains lf) { //convert line-endings message = string.replaceAll (message, cr, cr+lf)}; message = string.replaceAll (message, "\r\n.\r\n", "\r\n..\r\n"); //replace lines beginning with a period with two periods if message beginsWith ".\r\n" { //if the first line begins with a period message = "." + message}; if not (message endsWith "\r\n") { message = message + "\r\n"}; add (message)}; //add our message text to the buffer on sendCommandToServer (stream, command) { //AR 10/27/1999 Çon sendCommandToServer (stream, command) //pre-6.1 code Çlocal (chunksize = 4 * 1024) Çlocal (lastWrite = clock.ticks ()) Çloop //write command to the stream Çtry Çif sizeof (command) <= chunkSize Çtcp.writeStream (stream, command) Çsys.systemTask() Çthread.sleepfor (0) Çbreak Çtcp.writeStream (stream, string.mid (command, 1, chunkSize)) Çcommand = string.delete (command, 1, chunkSize) Çsys.systemTask() Çthread.sleepfor (0) ÇlastWrite = clock.ticks () Çelse Çif (tryError contains "10035") and (clock.ticks () < (lastWrite + (60 * 10))) //10035 means the socket buffers are not ready, give them up to 10 seconds. Çsys.systemTask() Çthread.sleepfor (1) //yield this thread for a second to allow normal frontier processing Çelse Çtry {tcp.closeStream (stream)} ÇscriptError ("Error communicating with SMTP host: " + tryError) // re-throw the error Çreturn (true) try { tcp.writeStringToStream (stream, command, 4096, timeOutTicks / 60)} else { if flMessages { //clean up the message area msg ("")}; try {tcp.abortStream (stream)}; scriptError ("Can't send mail because a connection error occured: " + tryerror)}; return (true)}; on receiveServerResponse (stream) { //AR 10/27/1999 Çon receiveServerResponse (stream) //pre-6.1 code Çlocal (response = "", bytesPending = 0, ix, linetext) Çlocal (timeout = clock.ticks () + timeOutTicks) Çloop //read data from the stream Çcase tcp.statusStream (stream, @bytespending) Ç"DATA" //read data Çresponse = response + tcp.readStream (stream, bytespending) Çix = string.patternMatch ("\r\n", response) Çwhile (ix > 0) //handle multi-line responses Çlinetext = string.mid (response, 1, ix-1) Çif string.nthChar (linetext, 4) == ' ' //the final line of the response has a space as the fourth char Çreturn (linetext) Çresponse = string.delete (response, 1, ix+1) Çix = string.patternMatch ("\r\n", response) Çsys.systemTask() Çthread.sleepfor (0) Çtimeout = clock.ticks () + timeOutTicks Çcontinue Ç"OPEN" //waiting for data Çif clock.ticks () > timeout ÇscriptError ("Can't send mail because the connection to " + host + " timed out.") Çsys.systemTask() Çthread.sleepfor (0) Çcontinue Çelse //connection terminated prematurely Çtry {tcp.closeStream (stream)} ÇscriptError ("Can't send mail because the connection to " + host + " was terminated prematurely.") Çreturn ("") //this should never be executed, either we return the server's final response line or we throw a scripterror local (ix, linetext); loop { //read data from the stream try { tcp.readStreamUntil (stream, "\r\n", timeOutTicks / 60, @response)} else { try {tcp.abortStream (stream)}; if flMessages { //clean up the message area msg ("")}; scriptError ("Can't send mail because a connection error occured: " + tryerror)}; ix = string.patternMatch ("\r\n", response); while (ix > 0) { //handle multi-line responses linetext = string.mid (response, 1, ix-1); response = string.delete (response, 1, ix+1); if string.nthChar (linetext, 4) == ' ' { //the final line of the response has a space as the fourth char return (linetext)}; ix = string.patternMatch ("\r\n", response)}}; return ("")}; //this should never be executed, either we return the server's final response line or we throw a scripterror on executeCommand (command, expectResponse = nil) { //send a command to the server and handle the response local (statusline); sendCommandToServer (stream, command + "\r\n"); statusline = receiveServerResponse (stream); if flMessages { displayMsg (statusline)}; if (expectResponse != nil) and not (statusline beginsWith expectResponse) { closeConnection ("Can't send mail because of an unexpected server response. I said \"" + command + "\" and the server replied \"" + statusline + "\".")}; return (true)}; on addRecipient (recipient) { //send recipient command executeCommand ("RCPT TO: <" + string.cleanMailAddress (recipient) + ">", "25")}; //expect status code 250 or 251 on closeConnection (errorstring = "") { //also called in case of unexpected server responses try {executeCommand ("RSET")}; //don't expect a specific response, otherwise we might end up in an infinite loop try {executeCommand ("QUIT")}; try {tcp.closeStream (stream)}; if flMessages { //clean up the message area msg ("")}; if errorstring != "" { //possibly (re)throw scripterrors scriptError (errorstring)}}; local (stream); try { //try to open connection to server stream = tcp.openStream (host, port)} else { // fatal error scriptError ("Can't send mail because the connection to " + host + " could not be opened: " + tryError)}; bundle { //wait for server's initial connection greeting local (statusline); statusline = receiveServerResponse (stream); if flMessages { displayMsg (statusline)}; if not (statusline beginsWith "220") { closeConnection ("Can't send mail because the server, " + host + ", did not send a valid connection greeting. It said, \"" + statusline + "\".")}}; bundle { //say hello and reset state executeCommand ("HELO " + tcp.addressDecode (tcp.myAddress()), "250"); executeCommand ("RSET", "250")}; bundle { //specify sender and recipients executeCommand ("MAIL FROM: <" + string.cleanMailAddress (sender) + ">", "250"); local (i); if sizeOf (recipient) > 0 { for i = 1 to string.countFields (recipient, ',') { addRecipient (string.nthField (recipient, ',', i))}}; if sizeOf (cc) > 0 { for i = 1 to string.countFields (cc, ',') { addRecipient (string.nthField (cc, ',', i))}}; if sizeOf (bcc) > 0 { for i = 1 to string.countFields (bcc, ',') { addRecipient (string.nthField (bcc, ',', i))}}}; bundle { //send message data executeCommand ("DATA", "354"); sendCommandToServer (stream, buffer); executeCommand (".", "250")}; closeConnection (); return (true)} \ No newline at end of file --- 1,313 ---- ! FrontierVcsFile:2:scpt:system.verbs.builtins.tcp.sendMail ! on sendMail (recipient = "", subject = "", message = "", sender = user.prefs.mailAddress, cc = "", bcc = "", host = user.prefs.mailHost, mimeType = "text/plain", adrHdrTable = nil, timeOutTicks = 60 * 60, flMessages = true, port = user.prefs.mailHostPort, smtpAuth = user.prefs.mailSmtpAuth, senderPassword = user.prefs.mailPassword) { ! «Changes ! «3/6/06; 11:11:09 AM by TAC ! «added support for STMP AUTH using CRAM-MD5, LOGIN, and PLAIN ! «use Frontier.getProgramName for X-Mailer ! «7/5/05; 8:57:26 AM by TAC ! «removed Userland from X-Mailer ! «added port parameter ! «11/05/1999 at 12:57:30 AM by AR ! «Updated to use 6.1 TCP verbs. ! «Cleaned up low-level error messages to conform to "Can't do x because y" scheme. ! «7/25/99; 8:04:26 AM by DW ! «Loop over scripts in user.callbacks.sendmail table. ! «Wed, 16 Jun 1999 00:05:16 GMT by AR ! «Added optional adrHdrTable parameter, the address of a table. If an address is specified, its fields are added to the message header, possibly overriding standard header items. ! «Added optional timeOutTicks parameter. The default value is 3600 ticks (60 seconds). If the connection is idle for more than the specified number of ticks while waiting for a response from the server, the connection is closed and an error message is generated. ! «Added optional flMessages parameter. If it is true (the default), status messages will be displayed in Frontier's About window. The displayed messages are prefixed with the name of this script. Before we return, we clean up the message area. ! «Added extensive error checking and reporting code. If the script returns true, it is now safe to assume that the message was accepted by the server. Status messages received from the server indicating that an error has occured are no longer ignored. Whenever an error occurs, we try to shut down the connection gracefully before throwing a scripterror. ! «Calls to thread.sleepFor were added to the TCP read/write loops for improved thread-friendliness. ! ! bundle { //loop over callbacks ! if defined (user.callbacks.tcpSendMail) { ! local (i); ! for i = 1 to sizeof (user.callbacks.tcpSendMail) { ! try { ! local (adrcallback = @user.callbacks.tcpSendMail [i]); ! if typeof (adrcallback^) == scriptType { //avoid problems with item #1s ! if adrcallback^ (recipient, subject, message, sender, cc, bcc, mimetype) { ! «callback returns true if it consumed the sendMail operation ! return (true)}}}}}}; ! ! on displayMsg (s) { ! msg ("tcp.sendMail: " + s)}; ! ! local (buffer = "", response = ""); ! ! on add (s) { //appends crlf delimited items to our message buffer ! buffer = buffer + s + cr + lf}; ! ! bundle { //build the header and store in buffer ! local (addedFromTableList = {}); ! ! on addFromHeaderTable (s) { ! if (adrHdrTable != nil) and defined (adrHdrTable^.[s]) { ! add (nameOf (adrHdrTable^.[s]) + ": " + adrHdrTable^.[s]); ! addedFromTableList = addedFromTableList + string.lower (s); ! return (true)}; ! return (false)}; ! ! if not addFromHeaderTable ("X-Mailer") { ! add ("X-Mailer: " + Frontier.getProgramName () + " (" + sys.osName () + ")")}; ! ! if not addFromHeaderTable ("Mime-Version") { ! add ("Mime-Version: 1.0")}; ! ! if not addFromHeaderTable ("Content-Type") { ! add ("Content-Type: " + mimeType + "; charset=\"us-ascii\"")}; ! ! if not addFromHeaderTable ("Date") { ! add ("Date: " + date.netStandardString (clock.now ()))}; ! ! if not addFromHeaderTable ("To") { ! if sizeOf (recipient) > 0 { ! add ("To: " + recipient)}}; ! ! if not addFromHeaderTable ("CC") { ! if sizeOf (cc) > 0 { ! add ("CC: " + cc)}}; ! ! if not addFromHeaderTable ("From") { ! add ("From: " + sender)}; ! ! if not addFromHeaderTable ("Subject") { ! add ("Subject: " + subject)}; ! ! if adrHdrTable != nil { //now add remaining header fields from the table ! local (i); ! for i = 1 to sizeOf (adrHdrTable^) { ! if not (addedFromTableList contains string.lower (nameOf (adrHdrTable^ [i]))) { ! add (nameOf (adrHdrTable^ [i]) + ": " + adrHdrTable^ [i])}}}; ! add ("")}; //a blank line before the content is required! ! ! bundle { //build message body and store in buffer ! if not (message contains lf) { //convert line-endings ! message = string.replaceAll (message, cr, cr+lf)}; ! message = string.replaceAll (message, "\r\n.\r\n", "\r\n..\r\n"); //replace lines beginning with a period with two periods ! if message beginsWith ".\r\n" { //if the first line begins with a period ! message = "." + message}; ! if not (message endsWith "\r\n") { ! message = message + "\r\n"}; ! add (message)}; //add our message text to the buffer ! ! on sendCommandToServer (stream, command) { //AR 10/27/1999 ! «on sendCommandToServer (stream, command) //pre-6.1 code ! «local (chunksize = 4 * 1024) ! «local (lastWrite = clock.ticks ()) ! «loop //write command to the stream ! «try ! «if sizeof (command) <= chunkSize ! «tcp.writeStream (stream, command) ! «sys.systemTask() ! «thread.sleepfor (0) ! «break ! «tcp.writeStream (stream, string.mid (command, 1, chunkSize)) ! «command = string.delete (command, 1, chunkSize) ! «sys.systemTask() ! «thread.sleepfor (0) ! «lastWrite = clock.ticks () ! «else ! «if (tryError contains "10035") and (clock.ticks () < (lastWrite + (60 * 10))) //10035 means the socket buffers are not ready, give them up to 10 seconds. ! «sys.systemTask() ! «thread.sleepfor (1) //yield this thread for a second to allow normal frontier processing ! «else ! «try {tcp.closeStream (stream)} ! «scriptError ("Error communicating with SMTP host: " + tryError) // re-throw the error ! «return (true) ! try { ! tcp.writeStringToStream (stream, command, 4096, timeOutTicks / 60)} ! else { ! if flMessages { //clean up the message area ! msg ("")}; ! try {tcp.abortStream (stream)}; ! scriptError ("Can't send mail because a connection error occured: " + tryerror)}; ! return (true)}; ! ! on receiveServerResponse (stream) { //AR 10/27/1999 ! «on receiveServerResponse (stream) //pre-6.1 code ! «local (response = "", bytesPending = 0, ix, linetext) ! «local (timeout = clock.ticks () + timeOutTicks) ! «loop //read data from the stream ! «case tcp.statusStream (stream, @bytespending) ! «"DATA" //read data ! «response = response + tcp.readStream (stream, bytespending) ! «ix = string.patternMatch ("\r\n", response) ! «while (ix > 0) //handle multi-line responses ! «linetext = string.mid (response, 1, ix-1) ! «if string.nthChar (linetext, 4) == ' ' //the final line of the response has a space as the fourth char ! «return (linetext) ! «response = string.delete (response, 1, ix+1) ! «ix = string.patternMatch ("\r\n", response) ! «sys.systemTask() ! «thread.sleepfor (0) ! «timeout = clock.ticks () + timeOutTicks ! «continue ! «"OPEN" //waiting for data ! «if clock.ticks () > timeout ! «scriptError ("Can't send mail because the connection to " + host + " timed out.") ! «sys.systemTask() ! «thread.sleepfor (0) ! «continue ! «else //connection terminated prematurely ! «try {tcp.closeStream (stream)} ! «scriptError ("Can't send mail because the connection to " + host + " was terminated prematurely.") ! «return ("") //this should never be executed, either we return the server's final response line or we throw a scripterror ! local (ix, linetext); ! loop { //read data from the stream ! try { ! tcp.readStreamUntil (stream, "\r\n", timeOutTicks / 60, @response)} ! else { ! try {tcp.abortStream (stream)}; ! if flMessages { //clean up the message area ! msg ("")}; ! scriptError ("Can't send mail because a connection error occured: " + tryerror)}; ! ix = string.patternMatch ("\r\n", response); ! while (ix > 0) { //handle multi-line responses ! linetext = string.mid (response, 1, ix-1); ! response = string.delete (response, 1, ix+1); ! if string.nthChar (linetext, 4) == ' ' { //the final line of the response has a space as the fourth char ! return (linetext)}; ! ix = string.patternMatch ("\r\n", response)}}; ! return ("")}; //this should never be executed, either we return the server's final response line or we throw a scripterror ! ! on executeCommand (command, expectResponse = nil, adrResponse = nil) { //send a command to the server and handle the response ! local (statusline); ! sendCommandToServer (stream, command + "\r\n"); ! statusline = receiveServerResponse (stream); ! if flMessages { ! displayMsg (statusline)}; ! if (expectResponse != nil) and not (statusline beginsWith expectResponse) { ! closeConnection ("Can't send mail because of an unexpected server response. I said \"" + command + "\" and the server replied \"" + statusline + "\".")}; ! if adrResponse != nil { ! adrResponse^ = statusline}; ! return (true)}; ! ! on addRecipient (recipient) { //send recipient command ! executeCommand ("RCPT TO: <" + string.cleanMailAddress (recipient) + ">", "25")}; //expect status code 250 or 251 ! ! on closeConnection (errorstring = "") { //also called in case of unexpected server responses ! try {executeCommand ("RSET")}; //don't expect a specific response, otherwise we might end up in an infinite loop ! try {executeCommand ("QUIT")}; ! try {tcp.closeStream (stream)}; ! if flMessages { //clean up the message area ! msg ("")}; ! if errorstring != "" { //possibly (re)throw scripterrors ! scriptError (errorstring)}}; ! ! local (stream); ! ! try { //try to open connection to server ! stream = tcp.openStream (host, port)} ! else { // fatal error ! scriptError ("Can't send mail because the connection to " + host + " could not be opened: " + tryError)}; ! ! bundle { //wait for server's initial connection greeting ! local (statusline); ! statusline = receiveServerResponse (stream); ! if flMessages { ! displayMsg (statusline)}; ! if not (statusline beginsWith "220") { ! closeConnection ("Can't send mail because the server, " + host + ", did not send a valid connection greeting. It said, \"" + statusline + "\".")}}; ! ! bundle { //say hello and reset state ! executeCommand ("HELO " + tcp.addressDecode (tcp.myAddress()), "250"); ! executeCommand ("RSET", "250")}; ! ! local (flAuthenticated = false); ! ! smtpAuth = string.upper (smtpAuth); ! ! case smtpAuth { // authenticate ! "CRAM-MD5" { ! local (s); ! ! executeCommand ("AUTH " + smtpAuth, "334", @s); ! ! s = s - "334 "; ! s = base64.decode (s); ! ! s = string.hashCramMd5 (string.nthField (sender, '@', 1), string (senderPassword), s); ! s = base64.encode (s, 0); ! ! executeCommand (s, "235"); ! ! flAuthenticated = true}; ! "LOGIN" { ! local (s); ! ! executeCommand ("AUTH " + smtpAuth, "334", @s); ! ! bundle { // username ! s = s - "334 "; ! s = base64.decode (s); ! s = string.lower (s); ! ! if not (s == "username:") { ! scriptError ("SMTP AUTH LOGIN failed.")}; ! ! s = base64.encode (string.nthField (sender, '@', 1), 0); ! ! executeCommand (s, "334", @s)}; ! ! bundle { // password ! s = s - "334 "; ! s = base64.decode (s); ! s = string.lower (s); ! ! if not (s == "password:") { ! scriptError ("SMTP AUTH LOGIN failed.")}; ! ! s = base64.encode (string (senderPassword), 0); ! ! executeCommand (s, "235")}; ! ! flAuthenticated = true}; ! "PLAIN" { ! local (s); ! ! executeCommand ("AUTH " + smtpAuth, "334", @s); ! ! s = "\x0" + string.nthField (sender, '@', 1) + "\x0" + string (senderPassword); ! s = base64.encode (s, 0); ! ! executeCommand (s, "235"); ! ! flAuthenticated = true}}; ! ! bundle { // specify sender and recipients ! local (s = "MAIL FROM: <" + string.cleanMailAddress (sender) + ">"); ! ! if flAuthenticated { ! s = s + " AUTH=" + sender}; ! ! executeCommand (s, "250"); ! ! local (i); ! ! if sizeOf (recipient) > 0 { ! for i = 1 to string.countFields (recipient, ',') { ! addRecipient (string.nthField (recipient, ',', i))}}; ! ! if sizeOf (cc) > 0 { ! for i = 1 to string.countFields (cc, ',') { ! addRecipient (string.nthField (cc, ',', i))}}; ! ! if sizeOf (bcc) > 0 { ! for i = 1 to string.countFields (bcc, ',') { ! addRecipient (string.nthField (bcc, ',', i))}}}; ! ! bundle { //send message data ! executeCommand ("DATA", "354"); ! sendCommandToServer (stream, buffer); ! executeCommand (".", "250")}; ! ! closeConnection (); ! ! return (true)}; ! ! «bundle // testing ! «sendMail ("fro...@ya...", "tcp.sendMail SMTP AUTH CRAM-MD5", "This is a test of the tcp.sendMail verb using the SMTP AUTH CRAM-MD5 feature.", "yo...@yo...", smtpAuth: "CRAM-MD5", senderPassword: "your.password") ! «sendMail ("fro...@ya...", "tcp.sendMail SMTP AUTH LOGIN", "This is a test of the tcp.sendMail verb using the SMTP AUTH LOGIN feature.", "yo...@yo...", smtpAuth: "LOGIN", senderPassword: "your.password") ! «sendMail ("fro...@ya...", "tcp.sendMail SMTP AUTH PLAIN", "This is a test of the tcp.sendMail verb using the SMTP AUTH PLAIN feature.", "yo...@yo...", smtpAuth: "PLAIN", senderPassword: "your.password") \ No newline at end of file |
|
From: creecode <icr...@us...> - 2006-03-10 21:43:35
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/data/userPrefs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10168 Added Files: mailSmtpAuth mailPassword Log Message: new user prefs to support SMTP-AUTH --- NEW FILE: mailPassword --- FrontierVcsFile:2:TEXT:system.verbs.builtins.Frontier.data.userPrefs.mailPassword --- NEW FILE: mailSmtpAuth --- FrontierVcsFile:2:TEXT:system.verbs.builtins.Frontier.data.userPrefs.mailSmtpAuth |
|
From: creecode <icr...@us...> - 2006-03-10 21:38:43
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/string In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7090 Added Files: hexStringToBinary Log Message: convert a hex string to binary --- NEW FILE: hexStringToBinary --- (This appears to be a binary file; contents omitted.) |
|
From: creecode <icr...@us...> - 2006-03-10 21:37:59
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6539 Added Files: testCrypt Log Message: fUnits tests for crypt verbs --- NEW FILE: testCrypt --- (This appears to be a binary file; contents omitted.) |
|
From: creecode <icr...@us...> - 2006-03-10 21:35:38
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/crypt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5041 Added Files: cramMD5 hashWhirlpool hmacMD5 Log Message: a few verbs for new crypt verbs category --- NEW FILE: hmacMD5 --- (This appears to be a binary file; contents omitted.) --- NEW FILE: hashWhirlpool --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cramMD5 --- (This appears to be a binary file; contents omitted.) |
|
From: creecode <icr...@us...> - 2006-03-10 21:24:50
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31147 Modified Files: versions.h Log Message: bumped version to 10.1a8 for new winshell command, new crypt verbs category and other changes Index: versions.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/versions.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** versions.h 25 Feb 2006 18:52:17 -0000 1.16 --- versions.h 10 Mar 2006 21:24:33 -0000 1.17 *************** *** 70,77 **** #define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */ ! #define APP_REVISION_LEVEL 7 /* for non-final releases only */ ! #define APP_BUILD_NUMBER 7 /* increment by one for every release, final or not */ ! #define APP_VERSION_STRING "10.1a7" #else --- 70,77 ---- #define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */ ! #define APP_REVISION_LEVEL 8 /* for non-final releases only */ ! #define APP_BUILD_NUMBER 8 /* increment by one for every release, final or not */ ! #define APP_VERSION_STRING "10.1a8" #else *************** *** 96,103 **** #define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */ ! #define APP_REVISION_LEVEL 7 /* for non-final releases only */ ! #define APP_BUILD_NUMBER 7 /* increment by one for every release, final or not */ ! #define APP_VERSION_STRING "10.1a7" #endif --- 96,103 ---- #define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */ ! #define APP_REVISION_LEVEL 8 /* for non-final releases only */ ! #define APP_BUILD_NUMBER 8 /* increment by one for every release, final or not */ ! #define APP_VERSION_STRING "10.1a8" #endif *************** *** 122,129 **** #define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */ ! #define APP_REVISION_LEVEL 7 /* for non-final releases only */ ! #define APP_BUILD_NUMBER 7 /* increment by one for every release, final or not */ ! #define APP_VERSION_STRING "10.1a7" #endif --- 122,129 ---- #define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */ ! #define APP_REVISION_LEVEL 8 /* for non-final releases only */ ! #define APP_BUILD_NUMBER 8 /* increment by one for every release, final or not */ ! #define APP_VERSION_STRING "10.1a8" #endif |
|
From: creecode <icr...@us...> - 2006-03-10 21:21:06
|
Update of /cvsroot/frontierkernel/Frontier/Common/resources/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28548 Modified Files: kernelverbs.rc Log Message: added new verb category crypt and hashwhirlpool, hmacmd5, hashmd5 verbs Index: kernelverbs.rc =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/resources/Win32/kernelverbs.rc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kernelverbs.rc 9 Mar 2006 09:46:29 -0000 1.5 --- kernelverbs.rc 10 Mar 2006 21:21:01 -0000 1.6 *************** *** 515,519 **** "string\0", //Function Processor Name false, //Window required ! 58, //Count of verbs "delete\0", "insert\0", --- 515,519 ---- "string\0", //Function Processor Name false, //Window required ! 60, //Count of verbs "delete\0", "insert\0", *************** *** 571,577 **** "ansitoutf8\0", "ansitoutf16\0", ! "multiplereplaceall\0" "macromantoutf8\0", // 2006-02-25 creedon ! "utf8tomacroman\0" // 2006-02-25 creedon END --- 571,579 ---- "ansitoutf8\0", "ansitoutf16\0", ! "multiplereplaceall\0", "macromantoutf8\0", // 2006-02-25 creedon ! "utf8tomacroman\0", // 2006-02-25 creedon ! "hashWhirlpool\0", // 2006-03-04 creedon ! "hashhmacmd5\0" // 2006-03-05 creedon END *************** *** 1058,1059 **** --- 1060,1073 ---- "sqrt\0" END + + 1025 /* cryptverbs */ EFP DISCARDABLE + BEGIN + 1, // Number of "blocks" in this resource + "crypt\0", // Function Processor name + false, // Window required + 3, // Count of verbs + "hashWhirlpool\0", + "hmacMD5\0", + "hashMD5\0" + END + |
|
From: creecode <icr...@us...> - 2006-03-10 21:20:58
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28493 Modified Files: shell.c Added Files: whirlpool.c langcrypt.c Log Message: added new verb category crypt and hashwhirlpool, hmacmd5, hashmd5 verbs Index: shell.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shell.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shell.c 25 Jul 2005 21:10:11 -0000 1.12 --- shell.c 10 Mar 2006 21:20:52 -0000 1.13 *************** *** 1335,1338 **** --- 1335,1340 ---- dllinitverbs (); /*2004-11-29 aradke: langdll.c*/ + cryptinitverbs (); /* 2006-03-07 creedon: langcrypt.c */ + if (keyboardescape ()) /*check again before landinit; after this, must do shellquit*/ exittooperatingsystem (); --- NEW FILE: langcrypt.c --- #include "frontier.h" #include "standard.h" #include "langinternal.h" #include "kernelverbs.h" #include "kernelverbdefs.h" #include "resources.h" #include "tablestructure.h" #include "lang.h" #include "frontierconfig.h" #include "langcrypt.h" #include "md5.h" #include "whirlpool.h" typedef enum tycryptverbtoken { /* verbs that are processed by crypt.c */ hashwhirlpoolfunc, hmacmd5func, hashmd5func, ctcryptverbs } tycryptverbtoken; static boolean cryptfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { /* 2006-03-07 creedon: created, cribbed from htmlfunctionvalue */ hdltreenode hp1 = hparam1; tyvaluerecord *v = vreturned; setbooleanvalue (false, v); /* by default, crypt functions return false */ switch (token) { case hashwhirlpoolfunc: { /* 2006-03-04 creedon: Whirlpool hash */ Handle h; struct NESSIEstruct w; u8 digest [DIGESTBYTES]; short ctconsumed = 1; short ctpositional = 1; tyvaluerecord vtranslate; setbooleanvalue (true, &vtranslate); if (!getreadonlytextvalue (hp1, 1, &h)) return (false); flnextparamislast = true; if (!getoptionalparamvalue (hp1, &ctconsumed, &ctpositional, "\x0b""flTranslate", &vtranslate)) return (false); lockhandle (h); NESSIEinit (&w); NESSIEadd ((unsigned char *)(*h), 8 * gethandlesize (h), &w); NESSIEfinalize (&w, digest); unlockhandle (h); if (vtranslate.data.flvalue) { /* return a hex string */ bigstring bs; unsigned char enc [] = "0123456789abcdef"; long ix; Handle hresult; for (ix = 0; ix < DIGESTBYTES; ix++) { setstringcharacter (bs, 2 * ix, enc [(int) ((digest [ix]) / 16)]); setstringcharacter (bs, 2 * ix + 1, enc [(int) ((digest [ix]) % 16)]); } /* for */ setstringlength (bs, 128); if (!newtexthandle (bs, &hresult)) return (false); return (setheapvalue (hresult, stringvaluetype, v)); } else { /* return a binary of unknown type */ Handle hresult; if (!newfilledhandle (digest, 64, &hresult)) return (false); return (setbinaryvalue (hresult, typeunknown, v)); } return (true); } case hmacmd5func: { /* 2006-03-05 creedon: keyed-hashing for message authentication using md5 */ Handle hdata, hkey; unsigned char digest [16]; short ctconsumed = 2; short ctpositional = 2; tyvaluerecord vtranslate; setbooleanvalue (true, &vtranslate); if (!getreadonlytextvalue (hp1, 1, &hdata)) return (false); if (!getreadonlytextvalue (hp1, 2, &hkey)) return (false); flnextparamislast = true; if (!getoptionalparamvalue (hp1, &ctconsumed, &ctpositional, "\x0b""flTranslate", &vtranslate)) return (false); lockhandle (hkey); lockhandle (hdata); hmacmd5 ((unsigned char *)(*hdata), gethandlesize (hdata), (unsigned char *)(*hkey), gethandlesize (hkey), (caddr_t) digest); unlockhandle (hkey); unlockhandle (hdata); if (vtranslate.data.flvalue) { /* return a hex string */ bigstring bs; unsigned char enc [] = "0123456789abcdef"; long ix; Handle hresult; for (ix = 0; ix < 16; ix++) { setstringcharacter (bs, 2 * ix, enc [(int) ((digest [ix]) / 16)]); setstringcharacter (bs, 2 * ix + 1, enc [(int) ((digest [ix]) % 16)]); } /* for */ setstringlength (bs, 32); if (!newtexthandle (bs, &hresult)) return (false); return (setheapvalue (hresult, stringvaluetype, v)); } else { /* return a binary of unknown type */ Handle hresult; if (!newfilledhandle (digest, 16, &hresult)) return (false); return (setbinaryvalue (hresult, typeunknown, v)); } return (true); } case hashmd5func: { /* 2006-03-10 creedon: cribbed from stringverbs.c */ Handle x; MD5_CTX hashcontext; /* MD5 context. */ unsigned char checksum [16]; short ctconsumed = 1; short ctpositional = 1; tyvaluerecord vtranslate; if (!getreadonlytextvalue (hp1, 1, &x)) return (false); setbooleanvalue (true, &vtranslate); flnextparamislast = true; if (!getoptionalparamvalue (hp1, &ctconsumed, &ctpositional, "\x0b""flTranslate", &vtranslate)) return (false); lockhandle (x); MD5Init (&hashcontext); MD5Update (&hashcontext, (unsigned char *)(*x), gethandlesize (x)); MD5Final (checksum, &hashcontext); unlockhandle (x); if (vtranslate.data.flvalue) { /* return a hex string */ bigstring bs; unsigned char enc [] = "0123456789abcdef"; long ix; Handle h; for(ix = 0; ix < 16; ix++) { setstringcharacter (bs, 2 * ix, enc [(int)((checksum [ix]) / 16)]); setstringcharacter (bs, 2 * ix + 1, enc [(int)((checksum [ix]) % 16)]); } /* for */ setstringlength (bs, 32); if (!newtexthandle (bs, &h)) return (false); return (setheapvalue (h, stringvaluetype, v)); } else { /* return a binary of unknown type */ Handle h; if (!newfilledhandle (checksum, 16, &h)) return (false); return (setbinaryvalue (h, typeunknown, v)); } return (true); } default: getstringlist (langerrorlist, unimplementedverberror, bserror); return (false); } /* switch */ } /* cryptfunctionvalue */ boolean cryptinitverbs (void) { /* 2006-03-07 creedon: created, cribbed from htmlinitverbs */ return (loadfunctionprocessor (idcryptverbs, &cryptfunctionvalue)); } /* cryptinitverbs */ boolean hmacmd5 (unsigned char * text, int text_len, unsigned char * key, int key_len, caddr_t digest) { /* 2006-03-05 creedon: created, cribbed from rfc2104, with a few alterations to fit our code and style aradke had implemented this function as part of his crypto.dll also text; pointer to data stream text_len; length of data stream key; pointer to authentication key key_len; length of authentication key digest; caller digest to be filled in */ MD5_CTX context; unsigned char k_ipad [65]; /* inner padding - key XORd with ipad */ unsigned char k_opad [65]; /* outer padding - key XORd with opad */ unsigned char tk [16]; int i; if (key_len > 64) { /* if key is longer than 64 bytes reset it to key=MD5(key) */ MD5_CTX tctx; MD5Init (&tctx); MD5Update (&tctx, key, key_len); MD5Final (tk, &tctx); key = tk; key_len = 16; } /* the HMAC_MD5 transform looks like: MD5(K XOR opad, MD5(K XOR ipad, text)) where K is an n byte key ipad is the byte 0x36 repeated 64 times opad is the byte 0x5c repeated 64 times and text is the data being protected */ memset (k_ipad, 0, sizeof (k_ipad)); /* start out by storing key in pads */ memset (k_opad, 0, sizeof (k_opad)); memcpy (k_ipad, key, key_len); memcpy (k_opad, key, key_len); for (i=0; i < 64; i++) { /* XOR key with ipad and opad values */ k_ipad [i] ^= 0x36; k_opad [i] ^= 0x5c; } /* perform inner MD5 */ MD5Init (&context); /* init context for 1st pass */ MD5Update (&context, k_ipad, 64); /* start with inner pad */ MD5Update (&context, text, text_len); /* then text of datagram */ MD5Final (digest, &context); /* finish up 1st pass */ /* perform outer MD5 */ MD5Init (&context); /* init context for 2nd pass */ MD5Update (&context, k_opad, 64); /* start with outer pad */ MD5Update (&context, digest, 16); /* then results of 1st hash */ MD5Final (digest, &context); /* finish up 2nd pass */ return (true); } /* hmacmd5 */ --- NEW FILE: whirlpool.c --- /** * The Whirlpool hashing function. * * <P> * <b>References</b> * * <P> * The Whirlpool algorithm was developed by * <a href="mailto:pba...@sc...">Paulo S. L. M. Barreto</a> and * <a href="mailto:vin...@cr...">Vincent Rijmen</a>. * * See * P.S.L.M. Barreto, V. Rijmen, * ``The Whirlpool hashing function,'' * NESSIE submission, 2000 (tweaked version, 2001), * <https://www.cosic.esat.kuleuven.ac.be/nessie/workshop/submissions/whirlpool.zip> * * @author Paulo S.L.M. Barreto * @author Vincent Rijmen. [...1923 lines suppressed...] display(digest, DIGESTBYTES); printf("\n\n"); fflush(stdout); fflush(stdout); } #endif /* ?TRACE_INTERMEDIATE_VALUES */ int main(int argc, char *argv[]) { // testAPI(); // makeNESSIETestVectors(); makeISOTestVectors(); #ifdef TRACE_INTERMEDIATE_VALUES makeIntermediateValues(); #endif // ?TRACE_INTERMEDIATE_VALUES // timing(); return 0; } #endif |
|
From: creecode <icr...@us...> - 2006-03-10 21:20:47
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28406 Modified Files: kernelverbs.h kernelverbdefs.h Added Files: whirlpool.h langcrypt.h Log Message: added new verb category crypt and hashwhirlpool, hmacmd5, hashmd5 verbs Index: kernelverbs.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/kernelverbs.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kernelverbs.h 13 Jan 2005 23:54:18 -0000 1.3 --- kernelverbs.h 10 Mar 2006 21:20:41 -0000 1.4 *************** *** 35,39 **** extern boolean filelaunchanythingverb (hdltreenode, tyvaluerecord *); - extern boolean stringinitverbs (void); /*stringverbs.c*/ --- 35,38 ---- *************** *** 55,56 **** --- 54,58 ---- extern boolean mathinitverbs (void); /* langmath.c */ + + extern boolean cryptinitverbs (void); /* langcrypt.c */ + --- NEW FILE: langcrypt.h --- /* prototypes */ boolean hmacmd5 (unsigned char *, int, unsigned char *, int, caddr_t); /* 2006-03-05 creedon */ Index: kernelverbdefs.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/kernelverbdefs.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kernelverbdefs.h 13 Jan 2005 23:54:18 -0000 1.5 --- kernelverbdefs.h 10 Mar 2006 21:20:41 -0000 1.6 *************** *** 27,36 **** #define idopverbs 1000 ! #define idtableverbs 1001 #define idmenuverbs 1002 #define idwpverbs 1003 #define idpictverbs 1004 #define idlangverbs 1005 ! #define idstringverbs 1006 #define idfileverbs 1007 #define idrezverbs 1008 --- 27,36 ---- #define idopverbs 1000 ! #define idtableverbs 1001 #define idmenuverbs 1002 #define idwpverbs 1003 #define idpictverbs 1004 #define idlangverbs 1005 ! #define idstringverbs 1006 #define idfileverbs 1007 #define idrezverbs 1008 *************** *** 41,52 **** #define idsysverbs 1013 #define idlaunchverbs 1014 ! #define idclipboardverbs 1015 #define idfrontierverbs 1016 #define idcancoonverbs 1017 ! #define idthreadverbs 1018 ! #define iddbverbs 1019 #define idxmlverbs 1020 #define idhtmlverbs 1021 ! #define idquicktimeverbs 1022 /*7.0b4 PBS: QuickTime Player window verbs*/ #define idregexpverbs 1023 /*2003-04-22 AR: regular expression verbs*/ #define idmathverbs 1024 /*2004-12-29 SMD: extended math verbs*/ --- 41,54 ---- #define idsysverbs 1013 #define idlaunchverbs 1014 ! #define idclipboardverbs 1015 #define idfrontierverbs 1016 #define idcancoonverbs 1017 ! #define idthreadverbs 1018 ! #define iddbverbs 1019 #define idxmlverbs 1020 #define idhtmlverbs 1021 ! #define idquicktimeverbs 1022 /*7.0b4 PBS: QuickTime Player window verbs*/ #define idregexpverbs 1023 /*2003-04-22 AR: regular expression verbs*/ #define idmathverbs 1024 /*2004-12-29 SMD: extended math verbs*/ + #define idcryptverbs 1025 /* 2006-03-07 creedon: crypt verbs */ + --- NEW FILE: whirlpool.h --- #ifndef PORTABLE_C__ #define PORTABLE_C__ #include <limits.h> /* Definition of minimum-width integer types * * u8 -> unsigned integer type, at least 8 bits, equivalent to unsigned char * u16 -> unsigned integer type, at least 16 bits * u32 -> unsigned integer type, at least 32 bits * * s8, s16, s32 -> signed counterparts of u8, u16, u32 * * Always use macro's T8(), T16() or T32() to obtain exact-width results, * i.e., to specify the size of the result of each expression. */ typedef signed char s8; typedef unsigned char u8; #if UINT_MAX >= 4294967295UL typedef signed short s16; typedef signed int s32; typedef unsigned short u16; typedef unsigned int u32; #define ONE32 0xffffffffU #else typedef signed int s16; typedef signed long s32; typedef unsigned int u16; typedef unsigned long u32; #define ONE32 0xffffffffUL #endif #define ONE8 0xffU #define ONE16 0xffffU #define T8(x) ((x) & ONE8) #define T16(x) ((x) & ONE16) #define T32(x) ((x) & ONE32) #ifdef _MSC_VER typedef unsigned __int64 u64; typedef signed __int64 s64; #define LL(v) (v##i64) #define ONE64 LL(0xffffffffffffffff) #else /* !_MSC_VER */ typedef unsigned long long u64; typedef signed long long s64; #define LL(v) (v##ULL) #define ONE64 LL(0xffffffffffffffff) #endif /* ?_MSC_VER */ #define T64(x) ((x) & ONE64) #define ROTR64(v, n) (((v) >> (n)) | T64((v) << (64 - (n)))) /* * Note: the test is used to detect native 64-bit architectures; * if the unsigned long is strictly greater than 32-bit, it is * assumed to be at least 64-bit. This will not work correctly * on (old) 36-bit architectures (PDP-11 for instance). * * On non-64-bit architectures, "long long" is used. */ /* * U8TO32_BIG(c) returns the 32-bit value stored in big-endian convention * in the unsigned char array pointed to by c. */ #define U8TO32_BIG(c) (((u32)T8(*(c)) << 24) | ((u32)T8(*((c) + 1)) << 16) | ((u32)T8(*((c) + 2)) << 8) | ((u32)T8(*((c) + 3)))) /* * U8TO32_LITTLE(c) returns the 32-bit value stored in little-endian convention * in the unsigned char array pointed to by c. */ #define U8TO32_LITTLE(c) (((u32)T8(*(c))) | ((u32)T8(*((c) + 1)) << 8) | (u32)T8(*((c) + 2)) << 16) | ((u32)T8(*((c) + 3)) << 24)) /* * U8TO32_BIG(c, v) stores the 32-bit-value v in big-endian convention * into the unsigned char array pointed to by c. */ #define U32TO8_BIG(c, v) do { u32 x = (v); u8 *d = (c); d[0] = T8(x >> 24); d[1] = T8(x >> 16); d[2] = T8(x >> 8); d[3] = T8(x); } while (0) /* * U8TO32_LITTLE(c, v) stores the 32-bit-value v in little-endian convention * into the unsigned char array pointed to by c. */ #define U32TO8_LITTLE(c, v) do { u32 x = (v); u8 *d = (c); d[0] = T8(x); d[1] = T8(x >> 8); d[2] = T8(x >> 16); d[3] = T8(x >> 24); } while (0) /* * ROTL32(v, n) returns the value of the 32-bit unsigned value v after * a rotation of n bits to the left. It might be replaced by the appropriate * architecture-specific macro. * * It evaluates v and n twice. * * The compiler might emit a warning if n is the constant 0. The result * is undefined if n is greater than 31. */ #define ROTL32(v, n) (T32((v) << (n)) | ((v) >> (32 - (n)))) /* * Whirlpool-specific definitions. */ #define DIGESTBYTES 64 #define DIGESTBITS (8*DIGESTBYTES) /* 512 */ #define WBLOCKBYTES 64 #define WBLOCKBITS (8*WBLOCKBYTES) /* 512 */ #define LENGTHBYTES 32 #define LENGTHBITS (8*LENGTHBYTES) /* 256 */ typedef struct NESSIEstruct { u8 bitLength[LENGTHBYTES]; /* global number of hashed bits (256-bit counter) */ u8 buffer[WBLOCKBYTES]; /* buffer of data to hash */ int bufferBits; /* current number of bits on the buffer */ int bufferPos; /* current (possibly incomplete) byte slot on the buffer */ u64 hash[DIGESTBYTES/8]; /* the hashing state */ } NESSIEstruct; #endif /* PORTABLE_C__ */ /* prototypes */ /* 2006-03-06 creedon */ void NESSIEinit (NESSIEstruct *); void NESSIEadd (const unsigned char * const, unsigned long, NESSIEstruct *); void NESSIEfinalize (NESSIEstruct *, unsigned char *); void makeNESSIETestVectors (); void testAPI (void); |
|
From: creecode <icr...@us...> - 2006-03-10 21:20:44
|
Update of /cvsroot/frontierkernel/Frontier/Common/resources/Mac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28277 Modified Files: kernelverbs.r Log Message: added new verb category crypt and hashwhirlpool, hmacmd5, hashmd5 verbs Index: kernelverbs.r =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/resources/Mac/kernelverbs.r,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kernelverbs.r 9 Mar 2006 09:46:28 -0000 1.5 --- kernelverbs.r 10 Mar 2006 21:20:30 -0000 1.6 *************** *** 601,605 **** "multipleReplaceAll", "macromantoutf8", // 2006-02-25 creedon ! "utf8tomacroman" // 2006-02-25 creedon } } --- 601,607 ---- "multipleReplaceAll", "macromantoutf8", // 2006-02-25 creedon ! "utf8tomacroman", // 2006-02-25 creedon ! "hashWhirlpool", // 2006-03-04 creedon ! "hashhmacmd5" // 2006-03-05 creedon } } *************** *** 1122,1123 **** --- 1124,1137 ---- } }; + + resource 'EFP#' (idcryptverbs, "crypt") { /* 2006-03-07 creedon: crypt verbs */ + { + "crypt", false, { + + "hashWhirlpool", + "hmacMD5", + "hashMD5" + } + } + }; + |
|
From: creecode <icr...@us...> - 2006-03-10 19:54:09
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/crypt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23421/crypt Log Message: Directory /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/crypt added to the repository |
|
From: Andre R. <and...@us...> - 2006-03-10 18:07:13
|
Update of /cvsroot/frontierkernel/Frontier/build_XCode/Frontier.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19822/build_XCode/Frontier.xcode Modified Files: project.pbxproj Log Message: Fix broken absolute path for sysshellcall.c in XCode project by switching to relative path. Index: project.pbxproj =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/build_XCode/Frontier.xcode/project.pbxproj,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** project.pbxproj 9 Mar 2006 11:08:50 -0000 1.26 --- project.pbxproj 10 Mar 2006 18:07:07 -0000 1.27 *************** *** 11905,11911 **** lastKnownFileType = sourcecode.c.c; name = sysshellcall.c; ! path = /Volumes/Data/Development/frontierkernel_main/Frontier/Common/source/sysshellcall.c; ! refType = 0; ! sourceTree = "<absolute>"; }; 65AA438B09C03C8900A4B237 = { --- 11905,11911 ---- lastKnownFileType = sourcecode.c.c; name = sysshellcall.c; ! path = ../Common/source/sysshellcall.c; ! refType = 2; ! sourceTree = SOURCE_ROOT; }; 65AA438B09C03C8900A4B237 = { |
|
From: Andre R. <and...@us...> - 2006-03-10 17:09:22
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv463 Added Files: winShellCommand Log Message: Add glue script for new sys.winShellCommand kernel verb. --- NEW FILE: winShellCommand --- FrontierVcsFile:2:scpt:system.verbs.builtins.sys.winShellCommand on winShellCommand (s, adrExitCode=nil, adrStdErr=nil) { kernel (sys.winshellcommand)} |
|
From: Andre R. <and...@us...> - 2006-03-10 14:01:15
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3550/Common/source Modified Files: sysshellcall.c Log Message: Replace INVALID_FILE_ATTRIBUTES, not defined in Win32 SDK comming with Metrowerks CodeWarrior 8, with its value -1, obtained from more recent Win32 SDK headers. Index: sysshellcall.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/sysshellcall.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sysshellcall.c 10 Mar 2006 13:43:17 -0000 1.6 --- sysshellcall.c 10 Mar 2006 14:01:11 -0000 1.7 *************** *** 269,273 **** unlockhandle (hshell); ! return (attr != INVALID_FILE_ATTRIBUTES); } /*cmdshellexists*/ --- 269,273 ---- unlockhandle (hshell); ! return (attr != -1); /*!INVALID_FILE_ATTRIBUTES*/ } /*cmdshellexists*/ |
|
From: Andre R. <and...@us...> - 2006-03-10 13:44:18
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22342/Common/source Modified Files: shellsysverbs.c Log Message: The sys.winShellCommand verb now optionally also reads from the shell's stderr and returns its exit code. Index: shellsysverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellsysverbs.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shellsysverbs.c 9 Mar 2006 11:08:50 -0000 1.9 --- shellsysverbs.c 10 Mar 2006 13:44:15 -0000 1.10 *************** *** 691,706 **** case winshellcommandfunc: { ! Handle hcommand, hreturn; ! newemptyhandle (&hreturn); flnextparamislast = true; ! if (!getexempttextvalue (hparam1, 1, &hcommand)) return (false); ! if (!winshellcall (hcommand, hreturn)) { ! disposehandle (hreturn); disposehandle (hcommand); --- 691,730 ---- case winshellcommandfunc: { ! Handle hcommand; ! Handle houttext = nil; ! Handle herrtext = nil; ! long exitcode = 0; ! tyaddress adrexitcode, adrstderr; ! short ctconsumed = 1; ! short ctpositional = 1; ! boolean flneedexitcode, flneedstderr; ! tyvaluerecord val; ! if (!getexempttextvalue (hparam1, 1, &hcommand)) ! return (false); ! ! if (!getoptionaladdressparam (hparam1, &ctconsumed, &ctpositional, "\x0b" "adrExitCode", &adrexitcode.ht, adrexitcode.bs)) ! return (false); flnextparamislast = true; ! if (!getoptionaladdressparam (hparam1, &ctconsumed, &ctpositional, "\x0b" "adrStdErr", &adrstderr.ht, adrstderr.bs)) return (false); + + flneedexitcode = (adrexitcode.ht != nil) || !isemptystring (adrexitcode.bs); + + flneedstderr = (adrstderr.ht != nil) || !isemptystring (adrstderr.bs); + + newemptyhandle (&houttext); + + if (flneedstderr) + newemptyhandle (&herrtext); ! if (!winshellcall (hcommand, houttext, herrtext, ! (flneedexitcode ? &exitcode : nil))) { ! disposehandle (houttext); ! ! disposehandle (herrtext); disposehandle (hcommand); *************** *** 710,715 **** disposehandle (hcommand); ! return (setheapvalue (hreturn, stringvaluetype, v)); } --- 734,757 ---- disposehandle (hcommand); + + if (flneedexitcode) { + + setlongvalue (exitcode, &val); ! if (!langsetsymboltableval (adrexitcode.ht, adrexitcode.bs, val)) ! return (false); ! } ! ! if (flneedstderr) { ! ! setheapvalue (herrtext, stringvaluetype, &val); ! ! if (!langsetsymboltableval (adrstderr.ht, adrstderr.bs, val)) ! return (false); ! ! exemptfromtmpstack (&val); ! } ! ! return (setheapvalue (houttext, stringvaluetype, v)); } |
|
From: Andre R. <and...@us...> - 2006-03-10 13:43:51
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21908/Common/headers Modified Files: sysshellcall.h Log Message: winshellcall now optionally also reads from the shell's stderr and returns its exit code. Index: sysshellcall.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/sysshellcall.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sysshellcall.h 9 Mar 2006 11:08:50 -0000 1.2 --- sysshellcall.h 10 Mar 2006 13:43:44 -0000 1.3 *************** *** 35,39 **** #ifdef WIN95VERSION ! boolean winshellcall (Handle, Handle); #endif --- 35,39 ---- #ifdef WIN95VERSION ! boolean winshellcall (Handle, Handle, Handle, long*); #endif |
|
From: Andre R. <and...@us...> - 2006-03-10 13:43:20
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21680/Common/source Modified Files: sysshellcall.c Log Message: winshellcall now optionally also reads from the shell's stderr and returns its exit code. Index: sysshellcall.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/sysshellcall.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sysshellcall.c 10 Mar 2006 09:59:55 -0000 1.5 --- sysshellcall.c 10 Mar 2006 13:43:17 -0000 1.6 *************** *** 444,448 **** ! static boolean runcmdshell (Handle hshell, Handle hcommand, HANDLE *hout) { /* --- 444,448 ---- ! static boolean runcmdshell (Handle hshell, Handle hcommand, HANDLE *hprocess, HANDLE *hout, HANDLE *herr) { /* *************** *** 455,463 **** STARTUPINFO startupinfo; PROCESS_INFORMATION processinfo; ! HANDLE hpiperead = nil; ! HANDLE hpipewrite = nil; boolean fl; ! /*create pipe for reading from command shell*/ clearbytes (&securityinfo, sizeof (securityinfo)); --- 455,467 ---- STARTUPINFO startupinfo; PROCESS_INFORMATION processinfo; ! HANDLE houtread = nil; ! HANDLE houtwrite = nil; ! HANDLE herrread = nil; ! HANDLE herrwrite = nil; boolean fl; ! *hprocess = nil; ! ! /*create pipes for reading from command shell*/ clearbytes (&securityinfo, sizeof (securityinfo)); *************** *** 466,475 **** securityinfo.bInheritHandle = true; ! if (!CreatePipe (&hpiperead, &hpipewrite, &securityinfo, nil)) ! goto error; ! ! if (!SetHandleInformation (hpiperead, HANDLE_FLAG_INHERIT, 0)) ! goto error; /*init structs for creating process*/ --- 470,495 ---- securityinfo.bInheritHandle = true; ! if (hout) { /*caller interested in stdout*/ + if (!CreatePipe (&houtread, &houtwrite, &securityinfo, nil)) + goto error; + + if (!SetHandleInformation (houtread, HANDLE_FLAG_INHERIT, 0)) + goto error; + } + else + houtwrite = GetStdHandle (STD_OUTPUT_HANDLE); + + if (herr) { /*caller interested in stderr*/ + + if (!CreatePipe (&herrread, &herrwrite, &securityinfo, nil)) + goto error; + + if (!SetHandleInformation (herrread, HANDLE_FLAG_INHERIT, 0)) + goto error; + } + else + herrwrite = GetStdHandle (STD_ERROR_HANDLE); + /*init structs for creating process*/ *************** *** 478,483 **** startupinfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; startupinfo.hStdInput = GetStdHandle (STD_INPUT_HANDLE); ! startupinfo.hStdOutput = hpipewrite; ! startupinfo.hStdError = GetStdHandle (STD_ERROR_HANDLE); startupinfo.wShowWindow = SW_HIDE; --- 498,503 ---- startupinfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; startupinfo.hStdInput = GetStdHandle (STD_INPUT_HANDLE); ! startupinfo.hStdOutput = houtwrite; ! startupinfo.hStdError = herrwrite; startupinfo.wShowWindow = SW_HIDE; *************** *** 530,536 **** goto error; ! CloseHandle (hpipewrite); /*now inherited by child process*/ ! ! CloseHandle (processinfo.hProcess); CloseHandle (processinfo.hThread); --- 550,556 ---- goto error; ! CloseHandle (houtwrite); /*now inherited by child process*/ ! CloseHandle (herrwrite); ! CloseHandle (processinfo.hThread); *************** *** 538,542 **** disposehandle (hshell); ! *hout = hpiperead; return (true); --- 558,568 ---- disposehandle (hshell); ! *hprocess = processinfo.hProcess; ! ! if (hout) ! *hout = houtread; ! ! if (herr) ! *herr = herrread; return (true); *************** *** 546,555 **** exit: /*error is already set*/ ! if (!hpiperead) ! CloseHandle (hpiperead); ! if (!hpipewrite) ! CloseHandle (hpipewrite); disposehandle (hcmdline); disposehandle (hshell); --- 572,587 ---- exit: /*error is already set*/ ! if (hout && !houtread) ! CloseHandle (houtread); ! if (hout && !houtwrite) ! CloseHandle (houtwrite); + if (herr && !herrread) + CloseHandle (herrread); + + if (herr && !herrwrite) + CloseHandle (herrwrite); + disposehandle (hcmdline); disposehandle (hshell); *************** *** 559,608 **** ! static boolean readcmdresult (HANDLE hread, Handle hreturn) { /* ! 2006-03-09 aradke: read data from pipe until eof. ! we close our end of the pipe (hread) whether we succeed or not. */ ! char buf[1024]; ! long ct = 0; ! boolean fl; ! DWORD err = 0; ! while (true) { ! releasethreadglobals (); ! fl = ReadFile (hread, buf, sizeof (buf), &ct, nil); ! if (!fl) ! err = GetLastError (); ! grabthreadglobals (); ! if (fl && (ct == 0)) /*regular end of file*/ ! break; ! ! if (!fl) { ! if (err == ERROR_BROKEN_PIPE) ! fl = true; /*ignore broken pipe*/ ! else ! oserror (err); ! break; } - - if (ct > 0) { ! fl = enlargehandle (hreturn, ct, buf); ! if (!fl) ! break; } } /*while*/ ! CloseHandle (hread); return (fl); --- 591,677 ---- ! static boolean readcmdpipe (HANDLE hpipe, Handle hdata, boolean *flreadmore) { /* ! 2006-03-10 aradke: read from pipe if data is available */ ! DWORD ctavail, ctread; ! DWORD err; ! if (!PeekNamedPipe (hpipe, nil, nil, nil, &ctavail, nil)) ! goto error; ! ! if (ctavail > 0) { ! long oldsize, newsize; ! oldsize = gethandlesize (hdata); ! newsize = oldsize + ctavail; ! if (!sethandlesize (hdata, newsize)) { /*memory error*/ ! *flreadmore = false; ! return (false); ! } ! ! if (!ReadFile (hpipe, &((*hdata)[oldsize]), ctavail, &ctread, nil)) /*should not block*/ ! goto error; ! } ! ! return (true); ! error: ! ! *flreadmore = false; ! ! err = GetLastError (); ! ! if (err == ERROR_BROKEN_PIPE) ! return (true); ! ! oserror (err); ! ! return (false); ! }/*readcmpipe*/ ! ! ! static boolean readcmdresult (HANDLE houtread, HANDLE herrread, Handle houttext, Handle herrtext) { ! ! /* ! 2006-03-09 aradke: read data from pipe until eof. ! we close our end of the pipe (hread) whether we succeed or not. ! */ ! ! boolean flreadout = (houttext != nil); ! boolean flreaderr = (herrtext != nil); ! boolean fl = true; ! ! while (flreadout || flreaderr) { ! if (flreadout) { ! ! fl = readcmdpipe (houtread, houttext, &flreadout); ! if (!fl) ! break; /*error occurred*/ } ! if (flreaderr) { ! ! fl = readcmdpipe (herrread, herrtext, &flreaderr); ! if (!fl) ! break; /*error occurred*/ } + + langbackgroundtask (true); /*resting*/ } /*while*/ ! if (houtread) ! CloseHandle (houtread); ! ! if (herrread) ! CloseHandle (herrread); return (fl); *************** *** 610,614 **** ! boolean winshellcall (Handle hcommand, Handle hreturn) { /* --- 679,715 ---- ! static boolean getcmdexitcode (Handle hprocess, long *status) { ! ! /* ! 2006-03-10 aradke: wait for child process to exit, then get its exit code ! */ ! ! DWORD res; ! boolean fl = true; ! ! *status = 0; ! ! releasethreadglobals (); ! ! res = WaitForSingleObject (hprocess, INFINITE); ! ! grabthreadglobals (); ! ! if (res != WAIT_OBJECT_0) ! goto exit; ! ! fl = GetExitCodeProcess (hprocess, status); ! ! if (!fl) ! winerror (); ! ! exit: ! CloseHandle (hprocess); ! ! return (fl); ! } /*getcmdexitcode*/ ! ! ! boolean winshellcall (Handle hcommand, Handle houttext, Handle herrtext, long *exitcode) { /* *************** *** 617,634 **** this implementation relies on the win32 api only and does not require popen etc to be available in the c runtime library. */ Handle hshell = nil; ! HANDLE hread; if (!getcmdshell (&hshell)) return (false); ! if (!runcmdshell (hshell, hcommand, &hread)) /*consumes hshell*/ return (false); ! if (!readcmdresult (hread, hreturn)) /*consumes hread*/ return (false); ! return (true); } /*winshellcall*/ --- 718,750 ---- this implementation relies on the win32 api only and does not require popen etc to be available in the c runtime library. + + 2006-03-10 aradke: also read stderr of child process and get its exit code. + caller owns houttext (previously hreturn) and herrtext. if either is nil, + don't create and read respective pipe. */ Handle hshell = nil; ! HANDLE hprocess = nil; ! HANDLE hout = nil; ! HANDLE herr = nil; if (!getcmdshell (&hshell)) return (false); ! if (!runcmdshell (hshell, hcommand, &hprocess, ! ((houttext != nil) ? &hout : nil), ! ((herrtext != nil) ? &herr : nil))) /*consumes hshell*/ return (false); ! if (!readcmdresult (hout, herr, houttext, herrtext)) { /*consumes hout and herr*/ ! CloseHandle (hprocess); return (false); ! } ! ! if (exitcode == nil) ! CloseHandle (hprocess); ! else if (!getcmdexitcode (hprocess, exitcode)) /*consumes hprocess*/ ! return (false); ! return (true); } /*winshellcall*/ |
|
From: Andre R. <and...@us...> - 2006-03-10 13:42:17
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20555/Common/headers Modified Files: lang.h Log Message: Moved getoptionaladdressparam and getoptionaltableparam from langregexp.c to langvalue.c and made them publicly available via lang.h. Index: lang.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/lang.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** lang.h 13 Jan 2005 23:54:18 -0000 1.8 --- lang.h 10 Mar 2006 13:42:02 -0000 1.9 *************** *** 1195,1198 **** --- 1195,1202 ---- extern boolean getoptionalparamvalue (hdltreenode, short *, short *, bigstring, tyvaluerecord *); + extern boolean getoptionaladdressparam (hdltreenode , short *, short *, bigstring , hdlhashtable *, bigstring); /*2006-03-10 aradke*/ + + extern boolean getoptionaltableparam (hdltreenode , short *, short *, bigstring, hdlhashtable *); /*2006-03-10 aradke*/ + extern boolean getaddressparam (hdltreenode, short, tyvaluerecord *); |
|
From: Andre R. <and...@us...> - 2006-03-10 13:41:32
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19920/Common/source Modified Files: langregexp.c langvalue.c Log Message: Moved getoptionaladdressparam and getoptionaltableparam from langregexp.c to langvalue.c and made them publicly available via lang.h. Index: langvalue.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langvalue.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** langvalue.c 15 Dec 2005 21:42:52 -0000 1.8 --- langvalue.c 10 Mar 2006 13:41:29 -0000 1.9 *************** *** 4655,4658 **** --- 4655,4705 ---- + boolean getoptionaladdressparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *ht, bigstring bsname) { + + /* + Get an optional parameter that is expected to be an address value. + If the param is not specified or if it is nil, we don't return anything. + + 2006-03-10 aradke: transplanted from langregexp.c + */ + + tyvaluerecord vparam; + + setaddressvalue (nil, emptystring, &vparam); + + if (!getoptionalparamvalue (hfirst, ctconsumed, ctpositional, bsparam, &vparam)) + return (false); + + return (getaddressvalue (vparam, ht, bsname)); + } /*getoptionaladdressparam*/ + + + boolean getoptionaltableparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *htable) { + + /* + Get an optional parameter that is expected to be the address of a table. + If the param is not specified or if it is nil, we don't return anything. + If the param is a valid address, we make sure a table exists at the + indicated location and return a handle to it. + + 2006-03-10 aradke: transplanted from langregexp.c + */ + + hdlhashtable ht; + bigstring bsname; + + if (!getoptionaladdressparam (hfirst, ctconsumed, ctpositional, bsparam, &ht, bsname)) + return (false); + + if (ht == nil && isemptystring (bsname)) + return (true); + + if (!langassignnewtablevalue (ht, bsname, htable)) + return (false); + + return (true); + } /*getoptionaltableparam*/ + + boolean getaddressparam (hdltreenode hfirst, short pnum, tyvaluerecord *val) { Index: langregexp.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langregexp.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** langregexp.c 18 Feb 2006 19:40:59 -0000 1.11 --- langregexp.c 10 Mar 2006 13:41:29 -0000 1.12 *************** *** 847,893 **** - static boolean getoptionaladdressparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *ht, bigstring bsname) { - - /* - Get an optional parameter that is expected to be an address value. - If the param is not specified or if it is nil, we don't return anything. - */ - - tyvaluerecord vparam; - - setaddressvalue (nil, emptystring, &vparam); - - if (!getoptionalparamvalue (hfirst, ctconsumed, ctpositional, bsparam, &vparam)) - return (false); - - return (getaddressvalue (vparam, ht, bsname)); - } /*getoptionaladdressparam*/ - - - static boolean getoptionaltableparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdlhashtable *htable) { - - /* - Get an optional parameter that is expected to be the address of a table. - If the param is not specified or if it is nil, we don't return anything. - If the param is a valid address, we make sure a table exists at the - indicated location and return a handle to it. - */ - - hdlhashtable ht; - bigstring bsname; - - if (!getoptionaladdressparam (hfirst, ctconsumed, ctpositional, bsparam, &ht, bsname)) - return (false); - - if (ht == nil && isemptystring (bsname)) - return (true); - - if (!langassignnewtablevalue (ht, bsname, htable)) - return (false); - - return (true); - } /*getoptionaltableparam*/ - - static boolean getoptionallistparam (hdltreenode hfirst, short *ctconsumed, short *ctpositional, bigstring bsparam, hdllistrecord *hlist) { --- 847,850 ---- |
|
From: Andre R. <and...@us...> - 2006-03-10 10:00:07
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23553/Common/source Modified Files: sysshellcall.c Log Message: Improved error checking and reporting in winshellcall and its subroutines. Index: sysshellcall.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/sysshellcall.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sysshellcall.c 9 Mar 2006 22:19:54 -0000 1.4 --- sysshellcall.c 10 Mar 2006 09:59:55 -0000 1.5 *************** *** 33,36 **** --- 33,39 ---- #include "threads.h" #include "error.h" + #include "langinternal.h" /*for error strings*/ + #include "resources.h" /*for error strings*/ + #include "shell.h" #include "sysshellcall.h" *************** *** 38,42 **** #if defined(MACVERSION) && (TARGET_API_MAC_CARBON == 1) - #include "shell.h" #include "lang.h" #include "CallMachOFramework.h" --- 41,44 ---- *************** *** 208,211 **** --- 210,218 ---- #ifdef WIN95VERSION + #define CHDOUBLEQUOTE '"' + #define CHSEMICOLON ';' + #define CHBACKSLASH '\\' + #define CHNULL '\0' + static boolean getenvironmentvariable (char *name, boolean flwinerror, Handle *hresult) { *************** *** 218,222 **** long res; ! res = GetEnvironmentVariable (name, nil, 0); if (res == 0) { --- 225,229 ---- long res; ! res = GetEnvironmentVariable (name, nil, 0); /*get required space*/ if (res == 0) { *************** *** 231,237 **** lockhandle (h); ! res = GetEnvironmentVariable (name, *h, res); unlockhandle (h); if (!sethandlesize (h, res)) { /*drop trailing nil char*/ --- 238,246 ---- lockhandle (h); ! res = GetEnvironmentVariable (name, *h, res); /*get actual value*/ unlockhandle (h); + + assert (gethandlesize (h) == res + 1); if (!sethandlesize (h, res)) { /*drop trailing nil char*/ *************** *** 248,251 **** --- 257,264 ---- static boolean cmdshellexists (Handle hshell) { + /* + 2006-03-09 aradke: check whether a file exists at the given path + */ + DWORD attr; *************** *** 293,303 **** - #define CHDOUBLEQUOTE '"' - #define CHSEMICOLON ';' - #define CHBACKSLASH '\\' - - static boolean getnextpath (Handle hpath, long *ixstart, Handle *hitem) { Handle h; handlestream s; --- 306,315 ---- static boolean getnextpath (Handle hpath, long *ixstart, Handle *hitem) { + /* + 2006-03-10 aradke: extract the next item from a string delimited by semicolons + */ + Handle h; handlestream s; *************** *** 327,333 **** }/*while*/ /*extract item*/ ! if (!loadfromhandletohandle (s.data, ixstart, s.pos - *ixstart, false, &h)) return (false); --- 339,347 ---- }/*while*/ + assert (athandlestreameof (&s) || (nexthandlestreamcharacter (&s) == CHSEMICOLON)); + /*extract item*/ ! if (!loadfromhandletohandle (s.data, ixstart, min(s.pos, s.eof) - *ixstart, false, &h)) return (false); *************** *** 346,349 **** --- 360,368 ---- }/*while*/ + assert (athandlestreameof (&s)); + + if (s.eof == 0) + return (false); /*break out of potential infinite loop at end of path string*/ + if (lasthandlestreamcharacter (&s) != CHBACKSLASH) if (!writehandlestreamchar (&s, CHBACKSLASH)) { *************** *** 352,355 **** --- 371,376 ---- } + assert (lasthandlestreamcharacter (&s) == CHBACKSLASH); + *hitem = closehandlestream (&s); *************** *** 357,360 **** --- 378,401 ---- } /*getnextpath*/ + + static void cmdnotfounderror (Handle hshell) { + + /* + 2006-03-10 aradke: report missing command shell + */ + + bigstring bsshell, bs; + + texthandletostring (hshell, bsshell); + + poptrailingchars (bsshell, CHNULL); + + getstringlist (langerrorlist, cmdshellnotfounderror, bs); + + parsedialogstring (bs, (ptrstring) bsshell, nil, nil, nil, bs); + + shellerrormessage (bs); + } /*cmdnotfounderror*/ + static boolean searchcmdpath (Handle *hshell) { *************** *** 364,370 **** see if the command shell is located in any of the directories. caller is responsible for disposing hshell. - - TO DO: - - check length of hshell < MAX_PATH */ --- 405,408 ---- *************** *** 384,389 **** if (!pushhandle (*hshell, h)) goto exit; ! ! if (!enlargehandle (h, 1, "\0")) goto exit; --- 422,427 ---- if (!pushhandle (*hshell, h)) goto exit; ! ! if (!pushcharhandle (CHNULL, h)) goto exit; *************** *** 397,403 **** }/*while*/ ! /*not found*/ ! ! oserror (ERROR_FILE_NOT_FOUND); exit: --- 435,439 ---- }/*while*/ ! cmdnotfounderror (*hshell); exit: *************** *** 413,419 **** 2006-03-09 aradke: launch the command shell as a child process. we consume hshell, but caller is responsible for closing hout if we return true. - - TO DO: - - check length of hcmdline < MAX_PATH */ --- 449,452 ---- *************** *** 458,466 **** if (!concathandles (hshell, hcommand, &hcmdline)) goto exit; ! ! if (!enlargehandle (hshell, 1, "\0")) goto exit; ! if (!enlargehandle (hcmdline, 1, "\0")) goto exit; --- 491,499 ---- if (!concathandles (hshell, hcommand, &hcmdline)) goto exit; ! ! if (!pushcharhandle (CHNULL, hshell)) goto exit; ! if (!pushcharhandle (CHNULL, hcmdline)) goto exit; *************** *** 468,472 **** if (!cmdshellexists (hshell)) { ! if (!searchcmdpath (&hshell)) /*do a search path lookup*/ goto exit; } --- 501,505 ---- if (!cmdshellexists (hshell)) { ! if (!searchcmdpath (&hshell)) /*do a search path lookup, sets error*/ goto exit; } *************** *** 592,599 **** return (false); ! if (!runcmdshell (hshell, hcommand, &hread)) return (false); ! if (!readcmdresult (hread, hreturn)) return (false); --- 625,632 ---- return (false); ! if (!runcmdshell (hshell, hcommand, &hread)) /*consumes hshell*/ return (false); ! if (!readcmdresult (hread, hreturn)) /*consumes hread*/ return (false); |