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

The check of the symlink can return true even if lstat return -1, so be sure...

The check of the symlink can return true even if lstat return -1, so be sure to only pass if the lstat return 0 and the symlink check return true
parent 5a0847aa
No related branches found
No related tags found
No related merge requests found
......@@ -185,7 +185,7 @@ int env_make_symlink(stralloc *dst,stralloc *old_dst,sv_alltype *sv,uint8_t conf
* a directory. File means old format, in this case we enforce to pass
* to the new one. */
r = lstat(sym_version,&st) ;
if (S_ISLNK(st.st_mode))
if (S_ISLNK(st.st_mode) && !r)
{
if (sarealpath(&saversion,sym_version) == -1)
log_warn_return(LOG_EXIT_ZERO,"sarealpath of: ",sym_version) ;
......
......@@ -213,7 +213,7 @@ int ssexec_disable(int argc, char const *const *argv,char const *const *envp,sse
/** The force options can be only used if the service is not marked initialized.
* This option should only be used when we have a inconsistent state between
* the /var/lib/66/system/<tree>/servicedirs/* and /var/lib/66/system/<tree>/.resolve
* the /var/lib/66/system/<tree>/servicedirs/ and /var/lib/66/system/<tree>/.resolve
* directory meaning a service which is not present in the compiled db but its resolve file
* exist.*/
if (FORCE && ss_state_check(state,name))
......
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