mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-19 10:45:12 +00:00
Merge pull request #70 from s3fs-fuse/master
Fixed for #68(FreeBSD issue)
This commit is contained in:
commit
2724728476
@ -3165,7 +3165,7 @@ static int read_passwd_file(void)
|
||||
size_t first_pos = string::npos;
|
||||
size_t last_pos = string::npos;
|
||||
bool default_found = 0;
|
||||
bool aws_format;
|
||||
int aws_format;
|
||||
|
||||
// if you got here, the password file
|
||||
// exists and is readable by the
|
||||
|
@ -486,11 +486,13 @@ string get_username(uid_t uid)
|
||||
|
||||
// make buffer
|
||||
if(0 == maxlen){
|
||||
if(0 > (maxlen = (size_t)sysconf(_SC_GETPW_R_SIZE_MAX))){
|
||||
long res = sysconf(_SC_GETPW_R_SIZE_MAX);
|
||||
if(0 > res){
|
||||
DPRNNN("could not get max pw length.");
|
||||
maxlen = 0;
|
||||
return string("");
|
||||
}
|
||||
maxlen = res;
|
||||
}
|
||||
if(NULL == (pbuf = (char*)malloc(sizeof(char) * maxlen))){
|
||||
DPRNCRIT("failed to allocate memory.");
|
||||
@ -522,11 +524,13 @@ int is_uid_inculde_group(uid_t uid, gid_t gid)
|
||||
|
||||
// make buffer
|
||||
if(0 == maxlen){
|
||||
if(0 > (maxlen = (size_t)sysconf(_SC_GETGR_R_SIZE_MAX))){
|
||||
long res = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||
if(0 > res){
|
||||
DPRNNN("could not get max name length.");
|
||||
maxlen = 0;
|
||||
return -ERANGE;
|
||||
}
|
||||
maxlen = res;
|
||||
}
|
||||
if(NULL == (pbuf = (char*)malloc(sizeof(char) * maxlen))){
|
||||
DPRNCRIT("failed to allocate memory.");
|
||||
|
Loading…
Reference in New Issue
Block a user