summaryrefslogtreecommitdiffstats
path: root/source/lib/replace.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-19 12:31:16 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-19 12:31:16 +0000
commite9d6e2ea9a3dc01d3849b925c50702cda6ddf225 (patch)
tree2051603a7e7c1e8d59dbf0c83b1330f636a3000b /source/lib/replace.c
parent793609cbc2f657b91a59aec4a3f403bf826c7156 (diff)
downloadsamba-e9d6e2ea9a3dc01d3849b925c50702cda6ddf225.tar.gz
samba-e9d6e2ea9a3dc01d3849b925c50702cda6ddf225.tar.xz
samba-e9d6e2ea9a3dc01d3849b925c50702cda6ddf225.zip
Merge minor library fixes from HEAD to 3.0.
- setenv() replacement - mimir's ASN1/SPNEGO typo fixes - (size_t)-1 fixes for push_* returns - function argument signed/unsigned correction - ASN1 error handling (ensure we don't use initiailsed data) - extra net ads join error checking - allow 'set security discriptor' to fail - escape ldap strings in libads. - getgrouplist() correctness fixes (include primary gid) Andrew Bartlett
Diffstat (limited to 'source/lib/replace.c')
-rw-r--r--source/lib/replace.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/lib/replace.c b/source/lib/replace.c
index cd48b8d160f..0c62ec9bfa5 100644
--- a/source/lib/replace.c
+++ b/source/lib/replace.c
@@ -447,3 +447,21 @@ char *rep_inet_ntoa(struct in_addr ip)
return t;
}
#endif
+
+#ifndef HAVE_SETENV
+ int setenv(const char *name, const char *value, int overwrite)
+{
+ char *p = NULL;
+ int ret = -1;
+
+ asprintf(&p, "%s=%s", name, value);
+
+ if (overwrite || getenv(name)) {
+ if (p) ret = putenv(p);
+ } else {
+ ret = 0;
+ }
+
+ return ret;
+}
+#endif