~ubuntu-branches/ubuntu/oneiric/inspircd/oneiric-security

« back to all changes in this revision

Viewing changes to src/helperfuncs.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2008-11-15 20:39:50 UTC
  • mfrom: (1.1.4 upstream) (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081115203950-uv1pf98x2vkon7se
Tags: 1.1.21+dfsg-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #298418)
  - debian/patches/04_include-limits-h.dpatch:
    + Explicitly include limits.h for gcc 4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
450
450
        {
451
451
                if (Config->logpath.empty())
452
452
                {
453
 
#ifndef DARWIN
454
453
                        Config->logpath = Config->MyDir + "/ircd.log";
455
 
#else
456
 
                        Config->logpath = "/var/log/ircd.log";
457
 
#endif
458
454
                }
459
455
 
460
456
                Config->log_file = fopen(Config->logpath.c_str(),"a+");
476
472
 
477
473
void InspIRCd::CheckRoot()
478
474
{
479
 
#ifndef DARWIN
480
475
        if (geteuid() == 0)
481
476
        {
482
477
                printf("WARNING!!! You are running an irc server as ROOT!!! DO NOT DO THIS!!!\n\n");
483
478
                this->Log(DEFAULT,"Cant start as root");
484
 
#else
485
 
        if (geteuid() != 16)
486
 
        {
487
 
                printf("WARNING!!! You are not running inspircd as the ircdaemon user!!! YOU CAN NOT DO THIS!!!\n\n");
488
 
                this->Log(DEFAULT,"Must start as user ircdaemon");
489
 
#endif
490
479
                Exit(EXIT_STATUS_ROOT);
491
480
        }
492
481
}