diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-10-23 01:27:23 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-10-23 01:27:23 +0000 |
commit | 517806e676cdfa43c12e822afd3609dfb1ebe3cb (patch) | |
tree | 42d8bad3da4db3d11ef904838b56b81f6fa8ad82 /source3/smbwrapper/smbw.c | |
parent | d6ad9474b297e900bc3b7576f3b968b0eb70cae4 (diff) | |
download | samba-517806e676cdfa43c12e822afd3609dfb1ebe3cb.tar.gz samba-517806e676cdfa43c12e822afd3609dfb1ebe3cb.tar.bz2 samba-517806e676cdfa43c12e822afd3609dfb1ebe3cb.zip |
fixed problems with PWD - we no longer use the PWD env variable
instead the shared variable area is used.
this fixes problems with /bin/sh under solaris
(This used to be commit 4eb7b5c6a81447755dfa1be27479027333ed6f26)
Diffstat (limited to 'source3/smbwrapper/smbw.c')
-rw-r--r-- | source3/smbwrapper/smbw.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c index 23b5c9a9c7..c09d7509f0 100644 --- a/source3/smbwrapper/smbw.c +++ b/source3/smbwrapper/smbw.c @@ -50,6 +50,7 @@ void smbw_init(void) extern FILE *dbf; char *p; int eno; + pstring line; if (initialised) return; initialised = 1; @@ -96,13 +97,16 @@ void smbw_init(void) DEBUG(2,("SMBW_PREFIX is %s\n", smbw_prefix)); } - if ((p=getenv(SMBW_PWD_ENV))) { - pstrcpy(smbw_cwd, p); - DEBUG(4,("Initial cwd from smbw_cwd is %s\n", smbw_cwd)); - } else { - sys_getwd(smbw_cwd); - DEBUG(4,("Initial cwd from getwd is %s\n", smbw_cwd)); + slprintf(line,sizeof(line)-1,"PWD_%d", getpid()); + + p = smbw_getshared(line); + if (!p) { + DEBUG(0,("ERROR: %s is not set\n", line)); + exit(1); } + pstrcpy(smbw_cwd, p); + DEBUG(4,("Initial cwd is %s\n", smbw_cwd)); + smbw_busy--; set_maxfiles(SMBW_MAX_OPEN); @@ -1325,6 +1329,7 @@ int smbw_fork(void) pid_t child; int p[2]; char c=0; + pstring line; struct smbw_file *file, *next_file; struct smbw_server *srv, *next_srv; @@ -1356,6 +1361,9 @@ int smbw_fork(void) smbw_srv_close(srv); } + slprintf(line,sizeof(line)-1,"PWD_%d", getpid()); + smbw_setshared(line,smbw_cwd); + /* unblock the parent */ write(p[1], &c, 1); close(p[1]); |