Ejemplo n.º 1
0
void
render_finalize(r_context_t *c)
{
    rc_free(c->facelist.faces);
    rc_free(c->translist.faces);
    rc_free(c->r_faceinc);
    rc_free(c->skylist);
    render_backend_finalize(c);
}
Ejemplo n.º 2
0
void quit_program(int rc)
{
	set_process_permissions(0, 0, xstrtoo(VBOX_ROOT_UMASK, 0));

	modem_hangup(&vboxmodem);

	log_line(LOG_D, "Closing modem device (%d)...\n", vboxmodem.fd);

	if (vboxmodem_close(&vboxmodem) != 0)
	{
		log_line(LOG_E, "%s (%s)\n", vboxmodem_error(), strerror(errno));
	}

	if (isdnttyname)
	{
		printstring(temppathname, "%s/LCK..%s", LOCKDIR, isdnttyname);

		lock_remove(temppathname);

		printstring(temppathname, "%s/vboxgetty-%s.pid", PIDDIR, isdnttyname);

		pid_remove(temppathname);
	}

	scr_remove_interpreter();
	rc_free(rc_getty_c);
	breaklist_clear();
	log_close();

	exit(rc);
}
Ejemplo n.º 3
0
/*
 * release address
 */
void
rc_addrpool_release_addr(struct rcf_address *addr)
{
	if (addr->link_sa.le_prev)
		LIST_REMOVE(addr, link_sa);
	if (addr->link_pool.le_prev)
		LIST_REMOVE(addr, link_pool);
	rc_free(addr);
}
Ejemplo n.º 4
0
Archivo: tex.c Proyecto: Borf/CaveQuake
void
tex_freeobjs(r_context_t *c)
{
    glDeleteTextures(g->r_numtextures, c->r_textures);
    rc_free(c->r_textures);
}
Ejemplo n.º 5
0
static int userrc_parse(struct vboxuser *vboxuser, unsigned char *home)
{
	unsigned char   tempsectname[VBOX_MAX_RCLINE_SIZE + 1];
	struct passwd	*pwdent;
	struct group	*grpent;
	unsigned char  *varusr;
	unsigned char  *vargrp;
	unsigned char  *varspc;
	unsigned char  *varmsk;
	int				 havegroup;

	static struct vboxrc rc_user_c[] =
	{
		{ "user"		, NULL },
		{ "group"	, NULL },
		{ "umask"	, NULL },
		{ "hdspace"	, NULL },
		{ NULL		, NULL }
	};

	xstrncpy(temppathname, SYSCONFDIR		 , PATH_MAX);
	xstrncat(temppathname, "/vboxgetty.conf", PATH_MAX);

	xstrncpy(tempsectname, "vboxgetty-phone-"	 , VBOX_MAX_RCLINE_SIZE);
	xstrncat(tempsectname, vboxuser->localphone, VBOX_MAX_RCLINE_SIZE);

	if (rc_read(rc_user_c, temppathname, tempsectname) < 0) return(-1);

	varusr = rc_get_entry(rc_user_c, "user"	);
	vargrp = rc_get_entry(rc_user_c, "group"	);
	varspc = rc_get_entry(rc_user_c, "hdspace");
	varmsk = rc_get_entry(rc_user_c, "umask"  );

	vboxuser->uid		= 0;
	vboxuser->gid		= 0;
	vboxuser->space	= 0;
	vboxuser->umask	= 0;

	strcpy(vboxuser->home, "");
	strcpy(vboxuser->name, "");

	if ((!varusr) || (!*varusr))
	{
		log_line(LOG_E, "You *must* specify a user name or a user id!\n");

		rc_free(rc_user_c);

		return(-1);
	}

	if (*varusr == '#')
		pwdent = getpwuid((uid_t)xstrtol(&varusr[1], 0));
	else
		pwdent = getpwnam(varusr);

	if (!pwdent)
	{
		log_line(LOG_E, "Unable to locate \"%s\" in systems passwd list.\n", varusr);

		rc_free(rc_user_c);

		return(-1);
	}

	vboxuser->uid = pwdent->pw_uid;
	vboxuser->gid = pwdent->pw_gid;

	if ((strlen(home) + strlen(pwdent->pw_name) + 2) < (PATH_MAX - 100))
	{
		xstrncpy(vboxuser->name, pwdent->pw_name, VBOXUSER_USERNAME);

		printstring(vboxuser->home, "%s/%s", home, pwdent->pw_name);
	}
	else
	{
		log_line(LOG_E, "Oops! Spool directory name and user name too long!\n");

		rc_free(rc_user_c);

		return(-1);
	}

	if ((vargrp) && (*vargrp))
	{
		havegroup = 0;

		setgrent();
					
		while ((grpent = getgrent()))
		{
			if (*vargrp == '#')
			{
				if (grpent->gr_gid == (gid_t)xstrtol(&vargrp[1], 0))
				{
					vboxuser->gid = grpent->gr_gid;
					havegroup	  = 1;
								
					break;
				}
			}
			else
			{
				if (strcmp(grpent->gr_name, vargrp) == 0)
				{
					vboxuser->gid = grpent->gr_gid;
					havegroup	  = 1;
								
					break;
				}
			}
		}
					
		endgrent();

		if (!havegroup)
		{
			log_line(LOG_E, "Unable to locate \"%s\" in systems group list.\n", vargrp);

			rc_free(rc_user_c);

			return(-1);
		}
	}

	if (varspc) vboxuser->space = xstrtol(varspc, 0);
	if (varmsk) vboxuser->umask = xstrtoo(varmsk, 0);

	log_line(LOG_D, "User \"%s\" (%d.%d) [%04o] will be used...\n", vboxuser->name, vboxuser->uid, vboxuser->gid, vboxuser->umask);

	rc_free(rc_user_c);

	return(0);
}