summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-20 06:45:18 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-20 06:45:18 +0000
commitad64fc6bc5c76cee7d7abf2971ae5097cfb243b2 (patch)
treeb73b89ca9e2ffd7cb9119b0f5244ad2a80fd5c33
parente2fcb1880b060c41555d876fd51222f97f8fd8d1 (diff)
downloadsamba-ad64fc6bc5c76cee7d7abf2971ae5097cfb243b2.tar.gz
samba-ad64fc6bc5c76cee7d7abf2971ae5097cfb243b2.tar.bz2
samba-ad64fc6bc5c76cee7d7abf2971ae5097cfb243b2.zip
removed setenv(), replaced with smbw_setenv()
(This used to be commit 72bce217ef474f056d8f6675667ec78d1772ff37)
-rw-r--r--source3/lib/replace.c17
-rw-r--r--source3/smbwrapper/.cvsignore5
-rw-r--r--source3/smbwrapper/shared.c16
-rw-r--r--source3/smbwrapper/smbsh.c14
-rw-r--r--source3/smbwrapper/smbw.c1
-rw-r--r--source3/smbwrapper/smbw_dir.c2
6 files changed, 29 insertions, 26 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c
index a354458a68..56f6b9c637 100644
--- a/source3/lib/replace.c
+++ b/source3/lib/replace.c
@@ -293,20 +293,3 @@ char *rep_inet_ntoa(struct in_addr ip)
}
#endif
-
-#ifndef HAVE_SETENV
-/*****************************************************************
-set an env variable - some systems don't have this
-*****************************************************************/
- int setenv(const char *name, const char *value, int overwrite)
-{
- pstring s;
-
- if (!overwrite && getenv(name)) return 0;
-
- slprintf(s,sizeof(s)-1,"%s=%s", name, value);
-
- return putenv(s);
-}
-
-#endif
diff --git a/source3/smbwrapper/.cvsignore b/source3/smbwrapper/.cvsignore
index f636f36e53..7835612d32 100644
--- a/source3/smbwrapper/.cvsignore
+++ b/source3/smbwrapper/.cvsignore
@@ -1,3 +1,8 @@
*.po
*.po32
+kernel_stat.h
smbsh
+tst
+tst.c
+wrapper.h
+xstat.c
diff --git a/source3/smbwrapper/shared.c b/source3/smbwrapper/shared.c
index 69fa07dba8..3e6e19d9d1 100644
--- a/source3/smbwrapper/shared.c
+++ b/source3/smbwrapper/shared.c
@@ -56,7 +56,7 @@ void smbw_setup_shared(void)
slprintf(s,sizeof(s)-1,"%d", shared_fd);
- setenv("SMBW_HANDLE", s, 1);
+ smbw_setenv("SMBW_HANDLE", s);
return;
@@ -177,3 +177,17 @@ void smbw_setshared(const char *name, const char *val)
unlockit();
}
+
+
+/*****************************************************************
+set an env variable - some systems don't have this
+*****************************************************************/
+int smbw_setenv(const char *name, const char *value)
+{
+ pstring s;
+
+ slprintf(s,sizeof(s)-1,"%s=%s", name, value);
+
+ return putenv(s);
+}
+
diff --git a/source3/smbwrapper/smbsh.c b/source3/smbwrapper/smbsh.c
index 39623dc3ed..8df82e702d 100644
--- a/source3/smbwrapper/smbsh.c
+++ b/source3/smbwrapper/smbsh.c
@@ -89,28 +89,28 @@ int main(int argc, char *argv[])
smbw_setshared("PASSWORD", p);
}
- setenv("PS1", "smbsh$ ", 1);
+ smbw_setenv("PS1", "smbsh$ ");
sys_getwd(line);
- setenv("PWD", line, 1);
+ smbw_setenv("PWD", line);
slprintf(line,sizeof(line)-1,"%s/smbwrapper.so", libd);
- setenv("LD_PRELOAD", line, 1);
+ smbw_setenv("LD_PRELOAD", line);
slprintf(line,sizeof(line)-1,"%s/smbwrapper.32.so", libd);
if (file_exist(line, NULL)) {
slprintf(line,sizeof(line)-1,"%s/smbwrapper.32.so:DEFAULT", libd);
- setenv("_RLD_LIST", line, 1);
+ smbw_setenv("_RLD_LIST", line);
slprintf(line,sizeof(line)-1,"%s/smbwrapper.so:DEFAULT", libd);
- setenv("_RLD32_LIST", line, 1);
+ smbw_setenv("_RLD32_LIST", line);
} else {
slprintf(line,sizeof(line)-1,"%s/smbwrapper.so:DEFAULT", libd);
- setenv("_RLD_LIST", line, 1);
+ smbw_setenv("_RLD_LIST", line);
}
- execl("/bin/sh","sh",NULL);
+ execl("/bin/sh","smbsh",NULL);
printf("launch failed!\n");
return 1;
}
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c
index e43910c194..23b5c9a9c7 100644
--- a/source3/smbwrapper/smbw.c
+++ b/source3/smbwrapper/smbw.c
@@ -38,6 +38,7 @@ int smbw_busy=0;
/* needs to be here because of dumb include files on some systems */
int creat_bits = O_WRONLY|O_CREAT|O_TRUNC;
+
/*****************************************************
initialise structures
*******************************************************/
diff --git a/source3/smbwrapper/smbw_dir.c b/source3/smbwrapper/smbw_dir.c
index 6453c55871..543a7a77ba 100644
--- a/source3/smbwrapper/smbw_dir.c
+++ b/source3/smbwrapper/smbw_dir.c
@@ -415,7 +415,7 @@ int smbw_chdir(const char *name)
DEBUG(4,("set SMBW_CWD to %s\n", cwd));
pstrcpy(smbw_cwd, cwd);
- if (setenv(SMBW_PWD_ENV, smbw_cwd, 1)) {
+ if (smbw_setenv(SMBW_PWD_ENV, smbw_cwd)) {
DEBUG(4,("setenv failed\n"));
}