[Fedora-directory-commits] esc/mac mac-build.sh,1.3,1.4
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/mac
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10042
Modified Files:
mac-build.sh
Log Message:
Bump version.
Index: mac-build.sh
===================================================================
RCS file: /cvs/dirsec/esc/mac/mac-build.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mac-build.sh 4 Mar 2008 23:57:23 -0000 1.3
+++ mac-build.sh 6 Mar 2008 00:09:43 -0000 1.4
@@ -47,7 +47,7 @@
COOLKEY_TAG=HEAD
-ESC_VERSION=1.1.0-1
+ESC_VERSION=1.0.1-6
COOLKEY_DMG_NAME=SmartCardManager-$ESC_VERSION.OSX4.darwin.dmg
16 years
[Fedora-directory-commits] ldapserver/ldap/servers/slapd sasl_io.c, 1.13, 1.14
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16341
Modified Files:
sasl_io.c
Log Message:
Resolves: #428163
Summary: SASL IO functions set/get: argument mismatch
Fix description: When setting the IO functions in sasl_io_setup, use the local
memory to pass the IO functions. Plus, allocate the memory for backing up the
existing IO functions (real_iofns in the code), which is set in sasl_io_setup
and the area is released after setting it back in sasl_io_cleanup.
Index: sasl_io.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/sasl_io.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- sasl_io.c 18 Oct 2007 00:08:34 -0000 1.13
+++ sasl_io.c 5 Mar 2008 19:57:03 -0000 1.14
@@ -103,15 +103,16 @@
sasl_io_setup(Connection *c)
{
int ret = 0;
- struct lber_x_ext_io_fns *func_pointers = NULL;
+ struct lber_x_ext_io_fns func_pointers = {0};
+ struct lber_x_ext_io_fns *real_iofns = (struct lber_x_ext_io_fns *) slapi_ch_malloc(LBER_X_EXTIO_FNS_SIZE);
sasl_io_private *sp = (sasl_io_private*) slapi_ch_calloc(1, sizeof(sasl_io_private));
LDAPDebug( LDAP_DEBUG_CONNS,
"sasl_io_setup for connection %d\n", c->c_connid, 0, 0 );
/* Get the current functions and store them for later */
- ber_sockbuf_get_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, &func_pointers);
- sp->real_iofns = func_pointers;
- func_pointers = NULL;
+ real_iofns->lbextiofn_size = LBER_X_EXTIO_FNS_SIZE;
+ ber_sockbuf_get_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, real_iofns );
+ sp->real_iofns = real_iofns; /* released in sasl_io_cleanup */
/* Set up the private structure */
sp->real_handle = (struct lextiof_socket_private*) c->c_prfd;
@@ -119,13 +120,12 @@
/* Store the private structure in the connection */
c->c_sasl_io_private = sp;
/* Insert the sasl i/o functions into the ber layer */
- func_pointers = (struct lber_x_ext_io_fns *) slapi_ch_malloc(LBER_X_EXTIO_FNS_SIZE);
- func_pointers->lbextiofn_size = LBER_X_EXTIO_FNS_SIZE;
- func_pointers->lbextiofn_read = sasl_read_function;
- func_pointers->lbextiofn_write = sasl_write_function;
- func_pointers->lbextiofn_writev = NULL;
- func_pointers->lbextiofn_socket_arg = (struct lextiof_socket_private *) sp;
- ber_sockbuf_set_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, func_pointers);
+ func_pointers.lbextiofn_size = LBER_X_EXTIO_FNS_SIZE;
+ func_pointers.lbextiofn_read = sasl_read_function;
+ func_pointers.lbextiofn_write = sasl_write_function;
+ func_pointers.lbextiofn_writev = NULL;
+ func_pointers.lbextiofn_socket_arg = (struct lextiof_socket_private *) sp;
+ ret = ber_sockbuf_set_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, &func_pointers);
/* Setup the data buffers for the fast read path */
sasl_io_init_buffers(sp);
/* Reset the enable flag, so we don't process it again */
@@ -139,7 +139,6 @@
sasl_io_cleanup(Connection *c)
{
int ret = 0;
- struct lber_x_ext_io_fns *func_pointers = NULL;
sasl_io_private *sp = c->c_sasl_io_private;
if (sp) {
LDAPDebug( LDAP_DEBUG_CONNS,
@@ -148,9 +147,10 @@
slapi_ch_free((void**)&(sp->encrypted_buffer));
slapi_ch_free((void**)&(sp->decrypted_buffer));
/* Put the I/O functions back how they were */
- ber_sockbuf_get_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, &func_pointers);
- slapi_ch_free((void**)&func_pointers);
- ber_sockbuf_set_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, sp->real_iofns);
+ if (NULL != sp->real_iofns) {
+ ber_sockbuf_set_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, sp->real_iofns );
+ slapi_ch_free((void**)&(sp->real_iofns));
+ }
slapi_ch_free((void**)&sp);
c->c_sasl_io_private = NULL;
c->c_enable_sasl_io = 0;
16 years
[Fedora-directory-commits] esc/win32 build.sh, 1.3, 1.4 setup.iss, 1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/win32
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10737
Modified Files:
build.sh setup.iss
Log Message:
Bump versions.
Index: build.sh
===================================================================
RCS file: /cvs/dirsec/esc/win32/build.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- build.sh 12 Oct 2007 00:10:32 -0000 1.3
+++ build.sh 5 Mar 2008 00:06:55 -0000 1.4
@@ -76,7 +76,7 @@
#ESC values
ESC_NAME=esc
-ESC_VERSION_NO=1.1.0-0
+ESC_VERSION_NO=1.1.0-1
#Cygwin values
Index: setup.iss
===================================================================
RCS file: /cvs/dirsec/esc/win32/setup.iss,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- setup.iss 25 Jul 2007 20:13:02 -0000 1.1
+++ setup.iss 5 Mar 2008 00:06:55 -0000 1.2
@@ -21,7 +21,7 @@
[Setup]
AppName=Smart Card Manager
AppMutex=ESCMutex
-AppVerName=Smart Card Manager 1.0.1-6
+AppVerName=Smart Card Manager 1.1.0-1
AppPublisher=Fedora
CreateAppDir=true
Compression=lzma
@@ -42,7 +42,7 @@
InfoBeforeFile=info-before.txt
InfoAfterFile=info-after.txt
PrivilegesRequired=admin
-VersionInfoVersion=1.0.1.4
+VersionInfoVersion=1.1.0.1
[Files]
16 years
[Fedora-directory-commits] esc/mac mac-build.sh,1.2,1.3
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/mac
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3297
Modified Files:
mac-build.sh
Log Message:
Bump versions.
Index: mac-build.sh
===================================================================
RCS file: /cvs/dirsec/esc/mac/mac-build.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mac-build.sh 11 Oct 2007 20:34:26 -0000 1.2
+++ mac-build.sh 4 Mar 2008 23:57:23 -0000 1.3
@@ -42,12 +42,12 @@
IFD_EGATE_NAME=ifd-egate-0.05
IFD_EGATE_REL=15
-COOLKEY_PKG_NAME=SmartCardManager1.15.pkg
+COOLKEY_PKG_NAME=SmartCardManager1.16.pkg
COOLKEY_VOL_NAME=SMARTCARDMANAGER
COOLKEY_TAG=HEAD
-ESC_VERSION=1.1.0-0
+ESC_VERSION=1.1.0-1
COOLKEY_DMG_NAME=SmartCardManager-$ESC_VERSION.OSX4.darwin.dmg
16 years
[Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc ESC.js, 1.15, 1.16
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2790
Modified Files:
ESC.js
Log Message:
Add aol special phone home feature, and pass CUID token ID along with the phone home request. Bugs #352991, #418391.
Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ESC.js 7 Jun 2007 21:17:58 -0000 1.15
+++ ESC.js 4 Mar 2008 23:39:54 -0000 1.16
@@ -51,6 +51,8 @@
const ESC_FACE_TO_FACE_MODE = "esc.face.to.face.mode";
const ESC_SECURITY_URL="esc.security.url";
const ESC_SECURE_URL="esc.secure.url";
+const ESC_GLOBAL_PHONE_HOME_URL= "esc.global.phone.home.url";
+const SPECIAL_ATR="3B76940000FF6276010000";
const CLEAN_TOKEN = "cleanToken";
const UNINITIALIZED = 1;
@@ -288,6 +290,11 @@
return true;
}
+ //Check for special key since we have no phone home info.
+
+ if(!home) {
+ home = GetGlobalPhoneHomeUrl(keyType,keyID);
+ }
var homeRes = false;
@@ -309,6 +316,44 @@
return homeRes;
}
+
+//Get global phone home url only for a special key
+
+function GetGlobalPhoneHomeUrl(keyType,keyID)
+{
+
+ var globalIssuerURL=null;
+ var specialATR=SPECIAL_ATR;
+ var phonHomeURL= DoCoolKeyGetATR(keyType,keyID);
+
+ var specialAppletVerMaj=1;
+ var specialAppletVerMin=1;
+
+
+ var appletVerMaj = DoGetCoolKeyGetAppletVer(keyType, keyID , true);
+ var appletVerMin = DoGetCoolKeyGetAppletVer(keyType, keyID, false);
+
+
+ if( (appletVerMaj != specialAppletVerMaj) ||
+ ( appletVerMin > specialAppletVerMin)) {
+
+ return null;
+ }
+
+ var keyATR = DoCoolKeyGetATR(keyType,keyID);
+
+
+ if( keyATR != specialATR) {
+ return null;
+ }
+
+ globalIssuerURL = DoCoolKeyGetConfigValue(ESC_GLOBAL_PHONE_HOME_URL);
+
+
+ return globalIssuerURL;
+
+}
+
//Test Phone Home url in config UI
function DoPhoneHomeTest()
@@ -3561,12 +3606,18 @@
function DoCoolKeyGetIssuerUrl(keyType,keyID)
{
var url = null;
+ var isMac = 0;
+ var agent = navigator.userAgent.toLowerCase();
//Back door for testing, ignore the value if so configured
+ if(agent && agent.indexOf("mac") != -1) {
+ isMac = 1;
+ }
+
var ignoreIssuer = DoCoolKeyGetConfigValue(ESC_IGNORE_KEY_ISSUER_INFO);
- recordMessage("DoCoolKeyGetIssuerUrl ignoreIssuer: " + ignoreIssuer);
+ recordMessage("DoCoolKeyGetIssuerUrl agent " + agent);
if(ignoreIssuer == "yes")
{
@@ -3576,17 +3627,21 @@
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
+
var tries = 0;
- while(tries < 3)
+ while(tries < 3 )
{
url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
- if(url.length < 10) // Check for bogus junk
+ if(!isMac) {
+ break;
+ }
+
+ if(!url || url.length < 10) // Check for bogus junk
{
recordMessage("Bogus url found ....");
url = null;
- Sleep(150);
+ Sleep(250);
recordMessage("Going to try again... ");
}
else
@@ -3609,11 +3664,14 @@
{
url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
- if(url.length < 10) // Check for bogus junk
+ if(!isMac) {
+ break;
+ }
+ if(!url || url.length < 10) // Check for bogus junk
{
recordMessage("Bogus url found from exception....");
url = null;
- sleep(150);
+ sleep(250);
recordMessage("From exception. Going to try again... ");
}
else
@@ -3621,12 +3679,18 @@
tries ++;
}
+ if(url)
+ {
+ var issuer_config_value_exp = ConfigValueWithKeyID(keyID,KEY_ISSUER_URL);
+ var result_exp = DoCoolKeySetConfigValue(issuer_config_value_exp,url);
+ }
recordMessage("From exception returning " + url);
return url;
}
return url;
}
+
//Get ATR value of card
function DoCoolKeyGetATR(keyType,keyID)
{
@@ -4111,8 +4175,9 @@
if(!theUrl || !aKeyID)
return false;
- if(theUrl != null)
- url = theUrl;
+ if(theUrl != null) {
+ url = theUrl + "?cuid=" + aKeyID;
+ }
var req = new XMLHttpRequest();
req.overrideMimeType('text/xml');
16 years
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication repl5_protocol_util.c, 1.11, 1.12
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11136/ldap/servers/plugins/replication
Modified Files:
repl5_protocol_util.c
Log Message:
Resolves: 435730
Summary: Allow fractional replication between masters.
Index: repl5_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_protocol_util.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- repl5_protocol_util.c 3 Oct 2007 00:55:34 -0000 1.11
+++ repl5_protocol_util.c 3 Mar 2008 18:35:11 -0000 1.12
@@ -378,27 +378,6 @@
default:
return_value = ACQUIRE_FATAL_ERROR;
}
- /* Now check for fractional compatibility with the replica
- * We need to do the check now because prior to acquiring the
- * replica we do not have sufficient access rights to read the replica id
- */
- /* Check if this is a fractional agreement, we need to
- * verify that the consumer is read-only */
- if ((return_value == ACQUIRE_SUCCESS) &&
- agmt_is_fractional(prp->agmt)) {
- crc = conn_replica_is_readonly(conn);
- if (CONN_IS_NOT_READONLY == crc) {
- /* This is a fatal error */
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "%s: Unable to acquire replica: "
- "the agreement is fractional but the replica is not read-only. Fractional agreements must specify a read-only replica "
- "Replication is aborting.\n",
- agmt_get_long_name(prp->agmt));
- prp->last_acquire_response_code = NSDS50_REPL_INTERNAL_ERROR;
- return_value = ACQUIRE_FATAL_ERROR;
- goto error;
- }
- }
}
else
{
16 years
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication repl5_protocol_util.c, 1.11, 1.11.2.1
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10991/ldap/servers/plugins/replication
Modified Files:
Tag: Directory_Server_8_0_Branch
repl5_protocol_util.c
Log Message:
Resolves: 435730
Summary: Allow fractional replication between masters.
Index: repl5_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_protocol_util.c,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -r1.11 -r1.11.2.1
--- repl5_protocol_util.c 3 Oct 2007 00:55:34 -0000 1.11
+++ repl5_protocol_util.c 3 Mar 2008 18:30:04 -0000 1.11.2.1
@@ -378,27 +378,6 @@
default:
return_value = ACQUIRE_FATAL_ERROR;
}
- /* Now check for fractional compatibility with the replica
- * We need to do the check now because prior to acquiring the
- * replica we do not have sufficient access rights to read the replica id
- */
- /* Check if this is a fractional agreement, we need to
- * verify that the consumer is read-only */
- if ((return_value == ACQUIRE_SUCCESS) &&
- agmt_is_fractional(prp->agmt)) {
- crc = conn_replica_is_readonly(conn);
- if (CONN_IS_NOT_READONLY == crc) {
- /* This is a fatal error */
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "%s: Unable to acquire replica: "
- "the agreement is fractional but the replica is not read-only. Fractional agreements must specify a read-only replica "
- "Replication is aborting.\n",
- agmt_get_long_name(prp->agmt));
- prp->last_acquire_response_code = NSDS50_REPL_INTERNAL_ERROR;
- return_value = ACQUIRE_FATAL_ERROR;
- goto error;
- }
- }
}
else
{
16 years
[Fedora-directory-commits] adminutil configure.ac, 1.10, 1.11 aclocal.m4, 1.13, 1.14 configure, 1.13, 1.14 missing, 1.12, 1.13 install-sh, 1.12, 1.13 Makefile.in, 1.13, 1.14 depcomp, 1.12, 1.13 config.sub, 1.12, 1.13 config.guess, 1.12, 1.13 compile, 1.12, 1.13
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/adminutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10139
Modified Files:
configure.ac aclocal.m4 configure missing install-sh
Makefile.in depcomp config.sub config.guess compile
Log Message:
bump version to 1.1.6
Index: configure.ac
===================================================================
RCS file: /cvs/dirsec/adminutil/configure.ac,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- configure.ac 11 Oct 2007 02:56:30 -0000 1.10
+++ configure.ac 3 Mar 2008 18:07:06 -0000 1.11
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([adminutil], [1.1.5], [http://bugzilla.redhat.com/])
+AC_INIT([adminutil], [1.1.6], [http://bugzilla.redhat.com/])
AM_INIT_AUTOMAKE([1.9 foreign subdir-objects])
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
Index: configure
===================================================================
RCS file: /cvs/dirsec/adminutil/configure,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- configure 11 Oct 2007 02:56:30 -0000 1.13
+++ configure 3 Mar 2008 18:07:06 -0000 1.14
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for adminutil 1.1.5.
+# Generated by GNU Autoconf 2.59 for adminutil 1.1.6.
#
# Report bugs to <http://bugzilla.redhat.com/>.
#
@@ -423,8 +423,8 @@
# Identity of this package.
PACKAGE_NAME='adminutil'
PACKAGE_TARNAME='adminutil'
-PACKAGE_VERSION='1.1.5'
-PACKAGE_STRING='adminutil 1.1.5'
+PACKAGE_VERSION='1.1.6'
+PACKAGE_STRING='adminutil 1.1.6'
PACKAGE_BUGREPORT='http://bugzilla.redhat.com/'
# Factoring default headers for most tests.
@@ -954,7 +954,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures adminutil 1.1.5 to adapt to many kinds of systems.
+\`configure' configures adminutil 1.1.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of adminutil 1.1.5:";;
+ short | recursive ) echo "Configuration of adminutil 1.1.6:";;
esac
cat <<\_ACEOF
@@ -1182,7 +1182,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-adminutil configure 1.1.5
+adminutil configure 1.1.6
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1196,7 +1196,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by adminutil $as_me 1.1.5, which was
+It was created by adminutil $as_me 1.1.6, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1839,7 +1839,7 @@
# Define the identity of the package.
PACKAGE='adminutil'
- VERSION='1.1.5'
+ VERSION='1.1.6'
cat >>confdefs.h <<_ACEOF
@@ -24401,7 +24401,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by adminutil $as_me 1.1.5, which was
+This file was extended by adminutil $as_me 1.1.6, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -24459,7 +24459,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-adminutil config.status 1.1.5
+adminutil config.status 1.1.6
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16 years
[Fedora-directory-commits] adminutil/lib/libadminutil form_post.c, 1.8, 1.9
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/adminutil/lib/libadminutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2494/adminutil/lib/libadminutil
Modified Files:
form_post.c
Log Message:
Resolves: bug 245248
Description: dsgw doesn't escape filename in error message
Reviewed by: nhosoi (Thanks!)
Fix Description: Do 2 passes on the input form data. In the first pass,
convert hex escapes (%xx) to the actual char. In the second pass, if the
char is one of the characters we must escape, convert to the html escape
form (e.g. '&' to "&") then write to output string. This way we can
catch cases where "%xx" evaluates to '&' for example.
Platforms tested: RHEL5 x86_64
Flag day: no
Doc: no
Index: form_post.c
===================================================================
RCS file: /cvs/dirsec/adminutil/lib/libadminutil/form_post.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- form_post.c 21 Jun 2007 22:32:24 -0000 1.8
+++ form_post.c 3 Mar 2008 17:59:45 -0000 1.9
@@ -140,6 +140,10 @@
}
for (x = 0, y = 0; x < l; x++, y++) {
+ /* first, do the url unescaping, if needed -
+ digit holds the candidate char to write
+ to the output string
+ */
if (('%' == str[x]) && (x < (l - 2))) {
++x;
digit = (str[x] >= 'A' ?
@@ -149,27 +153,31 @@
++x;
digit += (str[x] >= 'A' ?
((str[x] & 0xdf) - 'A') + 10 : (str[x] - '0'));
-
- rstr[y] = digit;
} else if (str[x] == '+') {
- rstr[y] = ' ';
- } else if ('<' == str[x]) {
+ digit = ' ';
+ } else {
+ digit = str[x];
+ }
+
+ /* next, see if digit (the original or the unescaped char)
+ needs to be html encoded */
+ if ('<' == digit) {
memcpy(&rstr[y], "<", 4);
y += 3;
- } else if ('>' == str[x]) {
+ } else if ('>' == digit) {
memcpy(&rstr[y], ">", 4);
y += 3;
- } else if ('&' == str[x]) {
+ } else if ('&' == digit) {
memcpy(&rstr[y], "&", 5);
y += 4;
- } else if ('"' == str[x]) {
+ } else if ('"' == digit) {
memcpy(&rstr[y], """, 6);
y += 5;
- } else if ('\'' == str[x]) {
+ } else if ('\'' == digit) {
memcpy(&rstr[y], "'", 5);
y += 4;
- } else {
- rstr[y] = str[x];
+ } else { /* just write the char to the output string */
+ rstr[y] = digit;
}
}
rstr[y] = '\0';
@@ -327,7 +335,7 @@
char *ans = NULL;
char buf[BUFSIZ];
- while(input[x]) {
+ while(input && input[x]) {
/* We want to get rid of the =, so len, len+1 */
if((!strncmp(input[x], varname, len)) && (*(input[x]+len) == '=')) {
if (!(ans = PL_strdup(input[x] + len + 1))) {
16 years