@@ -435,7 +435,7 @@ static void from_zval_write_sa_family(const zval *arr_value, char *field, ser_co
435435 memcpy (field , & ival , sizeof (ival ));
436436}
437437
438- #ifdef SO_PASSCRED
438+ #if defined( SO_PASSCRED ) || defined( LOCAL_CREDS_PERSISTENT )
439439static void from_zval_write_pid_t (const zval * arr_value , char * field , ser_context * ctx )
440440{
441441 zend_long lval ;
@@ -522,7 +522,7 @@ static void to_zval_read_uint32(const char *data, zval *zv, res_context *ctx)
522522 ZVAL_LONG (zv , (zend_long )ival );
523523}
524524#endif
525- #ifdef SO_PASSCRED
525+ #if defined( SO_PASSCRED ) || defined( LOCAL_CREDS_PERSISTENT )
526526static void to_zval_read_pid_t (const char * data , zval * zv , res_context * ctx )
527527{
528528 pid_t ival ;
@@ -1301,19 +1301,24 @@ void to_zval_read_in6_pktinfo(const char *data, zval *zv, res_context *ctx)
13011301}
13021302#endif
13031303
1304- /* CONVERSIONS for struct ucred/cmsgcred */
1305- #ifdef SO_PASSCRED
1304+ /* CONVERSIONS for struct ucred */
1305+ #if defined( SO_PASSCRED ) || defined( LOCAL_CREDS_PERSISTENT )
13061306static const field_descriptor descriptors_ucred [] = {
1307- #if defined(ANC_CREDS_UCRED )
1308- {"pid" , sizeof ("pid" ), 1 , offsetof(struct ucred , pid ), from_zval_write_pid_t , to_zval_read_pid_t },
1309- {"uid" , sizeof ("uid" ), 1 , offsetof(struct ucred , uid ), from_zval_write_uid_t , to_zval_read_uid_t },
1310- /* assume the type gid_t is the same as uid_t: */
1311- {"gid" , sizeof ("gid" ), 1 , offsetof(struct ucred , gid ), from_zval_write_uid_t , to_zval_read_uid_t },
1307+ #if defined(LOCAL_CREDS_PERSISTENT )
1308+ {"pid" , sizeof ("pid" ), 1 , offsetof(struct sockcred2 , sc_pid ), from_zval_write_pid_t , to_zval_read_pid_t },
1309+ {"uid" , sizeof ("uid" ), 1 , offsetof(struct sockcred2 , sc_euid ), from_zval_write_uid_t , to_zval_read_uid_t },
1310+ /* the type gid_t is the same as uid_t: */
1311+ {"gid" , sizeof ("gid" ), 1 , offsetof(struct sockcred2 , sc_egid ), from_zval_write_uid_t , to_zval_read_uid_t },
13121312#elif defined(ANC_CREDS_CMSGCRED )
13131313 {"pid" , sizeof ("pid" ), 1 , offsetof(struct cmsgcred , cmcred_pid ), from_zval_write_pid_t , to_zval_read_pid_t },
13141314 {"uid" , sizeof ("uid" ), 1 , offsetof(struct cmsgcred , cmcred_uid ), from_zval_write_uid_t , to_zval_read_uid_t },
13151315 /* assume the type gid_t is the same as uid_t: */
13161316 {"gid" , sizeof ("gid" ), 1 , offsetof(struct cmsgcred , cmcred_gid ), from_zval_write_uid_t , to_zval_read_uid_t },
1317+ #elif defined(SO_PASSCRED )
1318+ {"pid" , sizeof ("pid" ), 1 , offsetof(struct ucred , pid ), from_zval_write_pid_t , to_zval_read_pid_t },
1319+ {"uid" , sizeof ("uid" ), 1 , offsetof(struct ucred , uid ), from_zval_write_uid_t , to_zval_read_uid_t },
1320+ /* assume the type gid_t is the same as uid_t: */
1321+ {"gid" , sizeof ("gid" ), 1 , offsetof(struct ucred , gid ), from_zval_write_uid_t , to_zval_read_uid_t },
13171322#endif
13181323 {0 }
13191324};
0 commit comments