diff options
author | Geoff Thorpe <geoff@openssl.org> | 2001-11-22 08:48:09 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2001-11-22 08:48:09 +0000 |
commit | 9163b8fb238ece12091753c137db37b6489719bb (patch) | |
tree | 511dff750886c999fdc66643fc683b5316bcbe35 /crypto/dso | |
parent | a542db90c61ad90707c1cb44b350bc3a14fc0975 (diff) | |
download | openssl-new-9163b8fb238ece12091753c137db37b6489719bb.tar.gz |
'flags' should only be set inside DSO_load() if constructing a new DSO
object - otherwise we overwrite any flags that had been previously set in
the DSO before calling DSO_load().
Diffstat (limited to 'crypto/dso')
-rw-r--r-- | crypto/dso/dso.h | 3 | ||||
-rw-r--r-- | crypto/dso/dso_lib.c | 13 |
2 files changed, 7 insertions, 9 deletions
diff --git a/crypto/dso/dso.h b/crypto/dso/dso.h index 2855cf7761..a1678454a5 100644 --- a/crypto/dso/dso.h +++ b/crypto/dso/dso.h @@ -227,8 +227,7 @@ DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth); * for the first and third parameters. Use DSO_up and DSO_free for * subsequent reference count handling. Any flags passed in will be set * in the constructed DSO after its init() function but before the - * load operation. This will be done with; - * DSO_ctrl(dso, DSO_CTRL_SET_FLAGS, flags, NULL); */ + * load operation. If 'dso' is non-NULL, 'flags' is ignored. */ DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags); /* This function binds to a variable inside a shared library. */ diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c index ba1b196809..556069b9b8 100644 --- a/crypto/dso/dso_lib.c +++ b/crypto/dso/dso_lib.c @@ -205,6 +205,12 @@ DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags) goto err; } allocated = 1; + /* Pass the provided flags to the new DSO object */ + if(DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) + { + DSOerr(DSO_F_DSO_LOAD,DSO_R_CTRL_FAILED); + goto err; + } } else ret = dso; @@ -228,13 +234,6 @@ DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags) DSOerr(DSO_F_DSO_LOAD,DSO_R_NO_FILENAME); goto err; } - /* Bleurgh ... have to check for negative return values for - * errors. <grimace> */ - if(DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) - { - DSOerr(DSO_F_DSO_LOAD,DSO_R_CTRL_FAILED); - goto err; - } if(ret->meth->dso_load == NULL) { DSOerr(DSO_F_DSO_LOAD,DSO_R_UNSUPPORTED); |