ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.171 by root, Wed Jan 11 03:13:26 2006 UTC vs.
Revision 1.175 by root, Thu Jan 12 00:35:39 2006 UTC

284 if (parent[0]) 284 if (parent[0])
285 XDestroyWindow (disp, parent[0]); 285 XDestroyWindow (disp, parent[0]);
286 } 286 }
287 287
288 // TODO: free pixcolours, colours should become part of rxvt_display 288 // TODO: free pixcolours, colours should become part of rxvt_display
289
290 delete pix_colors_focused; 289 delete pix_colors_focused;
291#if OFF_FOCUS_FADING 290#if OFF_FOCUS_FADING
292 delete pix_colors_unfocused; 291 delete pix_colors_unfocused;
293#endif 292#endif
294 293
524 rs[Rs_perl_eval] = 0; 523 rs[Rs_perl_eval] = 0;
525 } 524 }
526 } 525 }
527#endif 526#endif
528 rxvt_perl.init (); 527 rxvt_perl.init ();
528 setlocale (LC_CTYPE, curlocale); // perl init destroys this info
529 HOOK_INVOKE ((this, HOOK_INIT, DT_END)); 529 HOOK_INVOKE ((this, HOOK_INIT, DT_END));
530 } 530 }
531#endif 531#endif
532 532
533 create_windows (argc, argv); 533 create_windows (argc, argv);
616 sw_int (this, &sig_handlers::sig_term) 616 sw_int (this, &sig_handlers::sig_term)
617 { 617 {
618 } 618 }
619} sig_handlers; 619} sig_handlers;
620 620
621char **rxvt_environ; // startup environment
622
621void 623void
622rxvt_init () 624rxvt_init ()
623{ 625{
626 rxvt_environ = environ;
627
624 /* 628 /*
625 * Save and then give up any super-user privileges 629 * Save and then give up any super-user privileges
626 * If we need privileges in any area then we must specifically request it. 630 * If we need privileges in any area then we must specifically request it.
627 * We should only need to be root in these cases: 631 * We should only need to be root in these cases:
628 * 1. write utmp entries on some systems 632 * 1. write utmp entries on some systems
704 case IGNORE: 708 case IGNORE:
705 /* 709 /*
706 * change effective uid/gid - not real uid/gid - so we can switch 710 * change effective uid/gid - not real uid/gid - so we can switch
707 * back to root later, as required 711 * back to root later, as required
708 */ 712 */
713 setegid (getgid ());
709 seteuid (getuid ()); 714 seteuid (getuid ());
710 setegid (getgid ());
711 break; 715 break;
712 case SAVE: 716 case SAVE:
717 saved_egid = getegid ();
713 saved_euid = geteuid (); 718 saved_euid = geteuid ();
714 saved_egid = getegid ();
715 break; 719 break;
716 case RESTORE: 720 case RESTORE:
721 setegid (saved_egid);
717 seteuid (saved_euid); 722 seteuid (saved_euid);
718 setegid (saved_egid);
719 break; 723 break;
720 } 724 }
721# else 725# else
722 switch (action) 726 switch (action)
723 { 727 {
724 case IGNORE: 728 case IGNORE:
729 setgid (getgid ());
725 setuid (getuid ()); 730 setuid (getuid ());
726 setgid (getgid ());
727 /* FALLTHROUGH */ 731 /* FALLTHROUGH */
728 case SAVE: 732 case SAVE:
729 /* FALLTHROUGH */ 733 /* FALLTHROUGH */
730 case RESTORE: 734 case RESTORE:
731 break; 735 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines