@@ -116,7 +116,7 @@ static int safesetid_security_capable(const struct cred *cred,
116116 * If no policy applies to this task, allow the use of CAP_SETUID for
117117 * other purposes.
118118 */
119- if (setid_policy_lookup ((kid_t )cred -> uid , INVALID_ID , UID ) == SIDPOL_DEFAULT )
119+ if (setid_policy_lookup ((kid_t ){. uid = cred -> uid } , INVALID_ID , UID ) == SIDPOL_DEFAULT )
120120 return 0 ;
121121 /*
122122 * Reject use of CAP_SETUID for functionality other than calling
@@ -131,7 +131,7 @@ static int safesetid_security_capable(const struct cred *cred,
131131 * If no policy applies to this task, allow the use of CAP_SETGID for
132132 * other purposes.
133133 */
134- if (setid_policy_lookup ((kid_t )cred -> gid , INVALID_ID , GID ) == SIDPOL_DEFAULT )
134+ if (setid_policy_lookup ((kid_t ){. gid = cred -> gid } , INVALID_ID , GID ) == SIDPOL_DEFAULT )
135135 return 0 ;
136136 /*
137137 * Reject use of CAP_SETUID for functionality other than calling
@@ -174,7 +174,7 @@ static bool id_permitted_for_cred(const struct cred *old, kid_t new_id, enum set
174174 * RUID.
175175 */
176176 permitted =
177- setid_policy_lookup ((kid_t )old -> uid , new_id , new_type ) != SIDPOL_CONSTRAINED ;
177+ setid_policy_lookup ((kid_t ){. uid = old -> uid } , new_id , new_type ) != SIDPOL_CONSTRAINED ;
178178
179179 if (!permitted ) {
180180 if (new_type == UID ) {
@@ -202,13 +202,13 @@ static int safesetid_task_fix_setuid(struct cred *new,
202202{
203203
204204 /* Do nothing if there are no setuid restrictions for our old RUID. */
205- if (setid_policy_lookup ((kid_t )old -> uid , INVALID_ID , UID ) == SIDPOL_DEFAULT )
205+ if (setid_policy_lookup ((kid_t ){. uid = old -> uid } , INVALID_ID , UID ) == SIDPOL_DEFAULT )
206206 return 0 ;
207207
208- if (id_permitted_for_cred (old , (kid_t )new -> uid , UID ) &&
209- id_permitted_for_cred (old , (kid_t )new -> euid , UID ) &&
210- id_permitted_for_cred (old , (kid_t )new -> suid , UID ) &&
211- id_permitted_for_cred (old , (kid_t )new -> fsuid , UID ))
208+ if (id_permitted_for_cred (old , (kid_t ){. uid = new -> uid } , UID ) &&
209+ id_permitted_for_cred (old , (kid_t ){. uid = new -> euid } , UID ) &&
210+ id_permitted_for_cred (old , (kid_t ){. uid = new -> suid } , UID ) &&
211+ id_permitted_for_cred (old , (kid_t ){. uid = new -> fsuid } , UID ))
212212 return 0 ;
213213
214214 /*
@@ -226,13 +226,13 @@ static int safesetid_task_fix_setgid(struct cred *new,
226226{
227227
228228 /* Do nothing if there are no setgid restrictions for our old RGID. */
229- if (setid_policy_lookup ((kid_t )old -> gid , INVALID_ID , GID ) == SIDPOL_DEFAULT )
229+ if (setid_policy_lookup ((kid_t ){. gid = old -> gid } , INVALID_ID , GID ) == SIDPOL_DEFAULT )
230230 return 0 ;
231231
232- if (id_permitted_for_cred (old , (kid_t )new -> gid , GID ) &&
233- id_permitted_for_cred (old , (kid_t )new -> egid , GID ) &&
234- id_permitted_for_cred (old , (kid_t )new -> sgid , GID ) &&
235- id_permitted_for_cred (old , (kid_t )new -> fsgid , GID ))
232+ if (id_permitted_for_cred (old , (kid_t ){. gid = new -> gid } , GID ) &&
233+ id_permitted_for_cred (old , (kid_t ){. gid = new -> egid } , GID ) &&
234+ id_permitted_for_cred (old , (kid_t ){. gid = new -> sgid } , GID ) &&
235+ id_permitted_for_cred (old , (kid_t ){. gid = new -> fsgid } , GID ))
236236 return 0 ;
237237
238238 /*
0 commit comments