lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 21 Dec 2013 13:11:26 +0100
From:	Pablo Neira Ayuso <pablo@...filter.org>
To:	valentina.giusti@...-carit.de
Cc:	netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
	jpa@...gle.com, fw@...nel.de, daniel.wagner@...-carit.de
Subject: Re: [PATCH v4 2/2] libnetfilter_queue: add support for UID/GID
 socket info

On Fri, Dec 20, 2013 at 05:28:54PM +0100, valentina.giusti@...-carit.de wrote:
> @@ -1180,6 +1183,18 @@ struct nfqnl_msg_packet_hw *nfq_get_packet_hw(struct nfq_data *nfad)
>  }
>  EXPORT_SYMBOL(nfq_get_packet_hw);
>  
> +uint32_t nfq_get_uid(struct nfq_data *nfad)
> +{
> +	return ntohl(nfnl_get_data(nfad->data, NFQA_UID, u_int32_t));
> +}
> +EXPORT_SYMBOL(nfq_get_uid);

Given that we'll have cases in which uid would not be present, I think
that the following interface would be better:

        int nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)

The function returns 1 if uid has been set (ie. it's available so you
can access it), otherwise it returns 0.

Same thing for _get_gid().

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ