mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Don't use pointer to 64 bit value (id_t) to point to 32 bit value (uid_t).
Found with: Coverity Prevent CID: 7466, 7467 MFC after: 2 weeks
This commit is contained in:
parent
2368a37125
commit
eec80038e3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208811
@ -50,7 +50,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric)
|
|||||||
acl_tag_t tag;
|
acl_tag_t tag;
|
||||||
struct passwd *pwd;
|
struct passwd *pwd;
|
||||||
struct group *grp;
|
struct group *grp;
|
||||||
id_t *id;
|
uid_t *id;
|
||||||
|
|
||||||
error = acl_get_tag_type(entry, &tag);
|
error = acl_get_tag_type(entry, &tag);
|
||||||
if (error)
|
if (error)
|
||||||
@ -62,7 +62,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ACL_USER:
|
case ACL_USER:
|
||||||
id = (id_t *)acl_get_qualifier(entry);
|
id = (uid_t *)acl_get_qualifier(entry);
|
||||||
if (id == NULL)
|
if (id == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
/* XXX: Thread-unsafe. */
|
/* XXX: Thread-unsafe. */
|
||||||
@ -81,7 +81,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ACL_GROUP:
|
case ACL_GROUP:
|
||||||
id = (id_t *)acl_get_qualifier(entry);
|
id = (uid_t *)acl_get_qualifier(entry);
|
||||||
if (id == NULL)
|
if (id == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
/* XXX: Thread-unsafe. */
|
/* XXX: Thread-unsafe. */
|
||||||
@ -141,7 +141,7 @@ format_additional_id(char *str, size_t size, const acl_entry_t entry)
|
|||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
acl_tag_t tag;
|
acl_tag_t tag;
|
||||||
id_t *id;
|
uid_t *id;
|
||||||
|
|
||||||
error = acl_get_tag_type(entry, &tag);
|
error = acl_get_tag_type(entry, &tag);
|
||||||
if (error)
|
if (error)
|
||||||
@ -155,7 +155,7 @@ format_additional_id(char *str, size_t size, const acl_entry_t entry)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
id = (id_t *)acl_get_qualifier(entry);
|
id = (uid_t *)acl_get_qualifier(entry);
|
||||||
if (id == NULL)
|
if (id == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
snprintf(str, size, ":%d", (unsigned int)*id);
|
snprintf(str, size, ":%d", (unsigned int)*id);
|
||||||
|
Loading…
Reference in New Issue
Block a user