/* This file is part of Lcrzo.
*/

int lcrzo_priv_stat_forbidslink(struct stat st)
{
#if defined LCRZODEF_SYSTEM_Unix
  lcrzo_int16 language;
  if (S_ISLNK(st.st_mode))
  { lcrzo_er(lcrzo_global_get_language(&language));
    if (language==LCRZO_GLOBAL_LANG_FR)
    { lcrzo_er(lcrzo_priv_global_set_errmsglcrzo("Le fichier est un lien symbolique"));
    }
    else
    { lcrzo_er(lcrzo_priv_global_set_errmsglcrzo("File is a symlink"));
    }
    return(LCRZO_ERR_SPFILESECURITY);
  }
#elif defined LCRZODEF_SYSTEM_Windows
  /* links under Windows are only files named "x.lnk" */
#else
 #error "Unknown value for LCRZODEF_SYSTEM"
#endif
  return(LCRZO_ERR_OK);
  /* just for the compiler warning */
  st.st_mode=st.st_mode;
}

