getpwnam("") && getgrnam("") returns an found entry but not NULL, is it a bug?
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