if(!hup)
{
- newuser(L"default", 0);
+ newuser(L"default", PERM_DISALLOW);
} else {
for(user = users; user != NULL; user = user->next)
{
{
struct uiuser *user, *next;
struct sockaddr_un *un;
+ struct passwd *pwd;
+ wchar_t *wcsname;
if(hup)
{
GCBREG(newfncb, newfnetnode, NULL);
GCBREG(newtransfercb, newtransfernotify, NULL);
}
+ if(getuid() != 0)
+ {
+ for(user = users; user != NULL; user = user->next)
+ {
+ if(wcscmp(user->name, L"default"))
+ break;
+ }
+ if(!user)
+ {
+ if((pwd = getpwuid(getuid())) == NULL)
+ {
+ flog(LOG_CRIT, "could not get login info: %s", strerror(errno));
+ return(1);
+ }
+ if((wcsname = icmbstowcs(pwd->pw_name, NULL)) == NULL)
+ {
+ flog(LOG_CRIT, "could not convert user name into wcs: %s", strerror(errno));
+ return(1);
+ }
+ newuser(wcsname, ~PERM_DISALLOW);
+ free(wcsname);
+ }
+ }
return(0);
}