/* This file is part of Lcrzo.
*/

int lcrzo_priv_stat_forbidschange(struct stat st1, struct stat st2)
{ lcrzo_int16 language;

  if ( st1.st_ino!=st2.st_ino ||
       st1.st_mode!=st2.st_mode || st1.st_nlink!=st2.st_nlink ||
#if defined LCRZODEF_SYSTEM_Unix
       st1.st_dev!=st2.st_dev   || 
#elif defined LCRZODEF_SYSTEM_Windows
       /* because fstat() returns a st_dev of zero */
#else
 #error "Unknown value for LCRZODEF_SYSTEM"
#endif
       st1.st_uid!=st2.st_uid   || st1.st_gid!=st2.st_gid ||
       st1.st_size!=st2.st_size )
  { lcrzo_er(lcrzo_global_get_language(&language));
    if (language==LCRZO_GLOBAL_LANG_FR)
    { lcrzo_er(lcrzo_priv_global_set_errmsglcrzo("Le fichier a change"));
    }
    else
    { lcrzo_er(lcrzo_priv_global_set_errmsglcrzo("File has changed"));
    }
    return(LCRZO_ERR_SPFILESECURITY);
  }

  return(LCRZO_ERR_OK);
}

