File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -121,11 +121,20 @@ fn extract_group_info(group: &Value) -> GraphInfoResult<GroupInfo> {
121
121
. as_str ( )
122
122
. ok_or ( GraphInfoRetrievalError :: BadJSONResponse ) ?
123
123
. to_string ( ) ;
124
- // we punt the question of a GID
124
+ let mut sid_parts : Vec < & str > = group[ "onPremisesSecurityIdentifier" ]
125
+ . as_str ( )
126
+ . ok_or ( GraphInfoRetrievalError :: BadJSONResponse ) ?
127
+ . split ( '-' ) . collect ( ) ;
128
+ let group_id = sid_parts. pop ( ) . unwrap ( ) . parse :: < u32 > ( ) ?;
129
+ // rid < 1000 should only be built-in groups
130
+ if group_id < 1000 {
131
+ return Err ( GraphInfoRetrievalError :: UnusableImmutableID ) ;
132
+ }
125
133
126
134
Ok ( GroupInfo {
127
135
groupname : group_name,
128
136
object_id : object_id,
137
+ group_id : group_id,
129
138
} )
130
139
}
131
140
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ pub struct UserInfo {
66
66
pub struct GroupInfo {
67
67
groupname : String ,
68
68
object_id : String ,
69
+ group_id : u32
69
70
}
70
71
71
72
/// The initgroups_dyn function populates a list of GIDs to which the named user belongs.
@@ -238,7 +239,7 @@ pub extern "C" fn _nss_aad_getgrnam_r(name: *const c_char,
238
239
} ;
239
240
240
241
match fill_group_buf ( result,
241
- config . group_ids [ name ] ,
242
+ groupinfo . group_id as gid_t ,
242
243
buffer,
243
244
buflen,
244
245
name,
You can’t perform that action at this time.
0 commit comments