Blame os/midipix.c

c95639
c95639
/* mlogin: minimalistic login                */
c95639
/* Copyright (c) 2019  Ørjan Malde           */
c95639
/* Released under LGPL, see COPYRIGHT.MLOGIN */
c95639
c95639
#include <unistd.h>
c95639
#include <pwd.h>
c95639
c93694
int switch_user_context(struct passwd *pwd, const char *username)
c95639
{
c95639
	(void)username;
c95639
c95639
	if(setgid(pwd->pw_gid))
c95639
		return 1;
c95639
	if(setuid(pwd->pw_uid))
c95639
		return 1;
c95639
	return 0;
c95639
}