int lstat_as_user(const char *fname, struct stat *s) {
	assert(fname);

	int called_as_root = 0;
	if (geteuid() == 0)
		called_as_root = 1;

	if (called_as_root)
		EUID_USER();

	int rv = lstat(fname, s);

	if (called_as_root)
		EUID_ROOT();

	return rv;
}
int lstat_as_user(const char *fname, struct stat *s) {
	assert(fname);

	int called_as_root = 0;
	if (geteuid() == 0)
		called_as_root = 1;

	if (called_as_root)
		EUID_USER();

	int rv = lstat(fname, s);

	if (called_as_root)
		EUID_ROOT();

	return rv;
}