summaryrefslogtreecommitdiff
path: root/source3/smbwrapper
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 /source3/smbwrapper
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)
Diffstat (limited to 'source3/smbwrapper')
-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
5 files changed, 29 insertions, 9 deletions
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"));
}