Skip to content
Snippets Groups Projects
Commit 7b446baa authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

overwritte PWD environment variable

parent a539de40
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
#include <string.h>
#include <stdio.h> //rename
#include <stdlib.h> //setenv
#include <oblibs/string.h>
#include <oblibs/types.h>
......@@ -28,6 +29,7 @@
#include <skalibs/stralloc.h>
#include <skalibs/direntry.h>
#include <skalibs/djbunix.h>
#include <skalibs/env.h>
#include <66/resolve.h>
#include <66/utils.h>
......@@ -282,7 +284,12 @@ int parse_module(sv_alltype *sv_before,char const *svname,uid_t owner,uint8_t fo
size_t clen = sv_before->type.module.configure > 0 ? 1 : 0 ;
char const *newargv[2 + clen] ;
unsigned int m = 0 ;
/** only overwrite the PWD variable
* Bash do not respect this, it set
* automatically the PWD variable. */
if (setenv("PWD",tmp.s,1) < 0) log_warnusys_return(LOG_EXIT_SYS,"set pwd environment variable") ;
newargv[m++] = tmp.s ;
if (sv_before->type.module.configure > 0)
newargv[m++] = keep.s + sv_before->type.module.configure ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment