• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
getpwnam("") && getgrnam("") returns an found entry but not NULL, is it a bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getpwnam("") && getgrnam("") returns an found entry but not NULL, is it a bug?


  • Subject: getpwnam("") && getgrnam("") returns an found entry but not NULL, is it a bug?
  • From: Reeze Xia <email@hidden>
  • Date: Fri, 10 Aug 2012 14:40:07 +0800

Hi, guy,
I don't know if this is the right mailing list to post, if not please forgive me plz :)

After upgrade to Mountain Lion: function getpwname() && getgrname("") returns an entry but not NULL.

Does Mountain lion have a hidden  user&group ? I thought it's a bug.

getpwnanm("") returns a entry with empty name but uid=0 gid=0,   0 is root users uid. this seems have security problem.

Can someone verify this for me please.  

Thanks for your time

-----------------
The below is reproducible code.
#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
#include <unistd.h>
#include <stdlib.h>

int main() {
    int ret;

    if(getgrnam("")) {
        printf("Found empty group\n");
    } else {
        printf("Right\n");
    }
    
    return 0;
}


Expected Results:
Right

Actual Results:
Found empty group



-- 
reeze | http://reeze.cn

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: getpwnam("") && getgrnam("") returns an found entry but not NULL, is it a bug?
      • From: Stephen Checkoway <email@hidden>
  • Prev by Date: Re: Kernel crash on mac os x <= 10.6.8
  • Next by Date: Re: getpwnam("") && getgrnam("") returns an found entry but not NULL, is it a bug?
  • Previous by thread: Re: I/O Scheduler
  • Next by thread: Re: getpwnam("") && getgrnam("") returns an found entry but not NULL, is it a bug?
  • Index(es):
    • Date
    • Thread