Changeset 2195

Show
Ignore:
Timestamp:
05/15/11 21:29:58 (2 years ago)
Author:
ahu
Message:

fix up error message on being unable to find a certain gid or uid, closing ticket 359.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/unix_utility.cc

    r1976 r2195  
    11/* 
    22    PowerDNS Versatile Database Driven Nameserver 
    3     Copyright (C) 2002 - 2009 PowerDNS.COM BV 
     3    Copyright (C) 2002 - 2011 PowerDNS.COM BV 
    44 
    55    This program is free software; you can redistribute it and/or modify 
     
    138138  int newgid; 
    139139  if(!(newgid=atoi(group.c_str()))) { 
     140    errno=0; 
    140141    struct group *gr=getgrnam(group.c_str()); 
    141142    if(!gr) { 
    142       theL()<<Logger::Critical<<"Unable to look up gid of group '"<<group<<"': "<<strerror(errno)<<endl; 
     143      theL()<<Logger::Critical<<"Unable to look up gid of group '"<<group<<"': "<< (errno ? strerror(errno) : "not found") <<endl; 
    143144      exit(1); 
    144145    } 
     
    156157    struct passwd *pw=getpwnam(username.c_str()); 
    157158    if(!pw) { 
    158       theL()<<Logger::Critical<<"Unable to look up uid of user '"<<username<<"': "<<strerror(errno)<<endl; 
     159      theL()<<Logger::Critical<<"Unable to look up uid of user '"<<username<<"': "<< (errno ? strerror(errno) : "not found") <<endl; 
    159160      exit(1); 
    160161    }