From: Jan Stancek <jstancek@redhat.com>
To: Yuan Sun <sunyuan3@huawei.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH V2] userns01: add capability verification
Date: Fri, 3 Jul 2015 11:18:16 +0200 [thread overview]
Message-ID: <20150703091815.GA2855@dustball.brq.redhat.com> (raw)
In-Reply-To: <55965241.5020206@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 320 bytes --]
On Fri, Jul 03, 2015 at 05:13:37PM +0800, Yuan Sun wrote:
> Hi Jan,
> The following link is unaccessible because HuaWei's network
> security strategy.
> Could you please attach the test.c file for me?
> http://fpaste.org/239445/35909330/
Was afraid my web email client would mangle it. Attached.
Regards,
Jan
[-- Attachment #2: test.c --]
[-- Type: text/plain, Size: 1094 bytes --]
#include <linux/types.h>
#include <sys/capability.h>
#include <stdio.h>
#define NUMBER_OF_CAP_SETS 3
#if defined(_LINUX_CAPABILITY_VERSION_3)
# if (_LINUX_CAPABILITY_VERSION_3 != 0x20080522)
# error Kernel <linux/capability.h> v3 does not match library
# error file "libcap.h" --> fix and recompile libcap
# else
# define _LIBCAP_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
# define _LIBCAP_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3
# endif
#endif
struct _cap_struct {
struct __user_cap_header_struct head;
union {
struct __user_cap_data_struct set;
__u32 flat[NUMBER_OF_CAP_SETS];
} u[_LIBCAP_CAPABILITY_U32S];
};
int main(void)
{
cap_t caps, expectedcaps;
int i;
caps = cap_get_proc();
expectedcaps = cap_from_text("=ep");
for (i = 0; i < _LIBCAP_CAPABILITY_U32S; i++)
printf("%08x ", caps->u[i].flat[CAP_EFFECTIVE]);
printf("\n");
for (i = 0; i < _LIBCAP_CAPABILITY_U32S; i++)
printf("%08x ", expectedcaps->u[i].flat[CAP_EFFECTIVE]);
printf("\n");
printf("cap_compare: %d\n", cap_compare(caps, expectedcaps));
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 351 bytes --]
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-07-03 9:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 4:22 [LTP] [PATCH V2] userns01: add capability verification Yuan Sun
2015-07-02 14:09 ` Jan Stancek
2015-07-03 3:05 ` Yuan Sun
2015-07-03 7:43 ` Jan Stancek
2015-07-03 9:13 ` Yuan Sun
2015-07-03 9:18 ` Jan Stancek [this message]
2015-07-03 9:24 ` Yuan Sun
2015-07-03 9:32 ` Jan Stancek
2015-07-03 9:37 ` Yuan Sun
2015-07-03 10:27 ` Jan Stancek
2015-07-03 10:51 ` Jan Stancek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150703091815.GA2855@dustball.brq.redhat.com \
--to=jstancek@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=sunyuan3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox