Advertisement
Guest User

Untitled

a guest
Mar 16th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.80 KB | None | 0 0
  1. From 8789c3c73f1ad0b260195a1a3214ff965d6f42d5 Mon Sep 17 00:00:00 2001
  2. From: Marchuk Nikolay <n1kolasM@users.noreply.github.com>
  3. Date: Thu, 16 Mar 2017 17:49:25 +0700
  4. Subject: [PATCH 1/2] Add ioctl namespace entries from Linux 4.11
  5.  
  6. Signed-off-by: Marchuk Nikolay <n1kolasM@users.noreply.github.com>
  7. ---
  8. linux/32/ioctls_inc_align16.h | 2 ++
  9. linux/32/ioctls_inc_align32.h | 2 ++
  10. linux/32/ioctls_inc_align64.h | 2 ++
  11. linux/64/ioctls_inc.h | 2 ++
  12. linux/x32/ioctls_inc0.h | 2 ++
  13. 5 files changed, 10 insertions(+)
  14.  
  15. diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h
  16. index 71c9d18..4e90801 100644
  17. --- a/linux/32/ioctls_inc_align16.h
  18. +++ b/linux/32/ioctls_inc_align16.h
  19. @@ -1455,6 +1455,8 @@
  20. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
  21. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
  22. { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
  23. +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
  24. +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
  25. { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
  26. { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
  27. { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
  28. diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h
  29. index 699eb90..4fcada1 100644
  30. --- a/linux/32/ioctls_inc_align32.h
  31. +++ b/linux/32/ioctls_inc_align32.h
  32. @@ -1455,6 +1455,8 @@
  33. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
  34. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
  35. { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
  36. +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
  37. +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
  38. { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
  39. { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
  40. { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
  41. diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h
  42. index fcd9d8c..3734082 100644
  43. --- a/linux/32/ioctls_inc_align64.h
  44. +++ b/linux/32/ioctls_inc_align64.h
  45. @@ -1455,6 +1455,8 @@
  46. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
  47. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
  48. { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
  49. +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
  50. +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
  51. { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
  52. { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
  53. { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
  54. diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h
  55. index f59fe11..b75abec 100644
  56. --- a/linux/64/ioctls_inc.h
  57. +++ b/linux/64/ioctls_inc.h
  58. @@ -1455,6 +1455,8 @@
  59. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
  60. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
  61. { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
  62. +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
  63. +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
  64. { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
  65. { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
  66. { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
  67. diff --git a/linux/x32/ioctls_inc0.h b/linux/x32/ioctls_inc0.h
  68. index 46303d1..81dd21c 100644
  69. --- a/linux/x32/ioctls_inc0.h
  70. +++ b/linux/x32/ioctls_inc0.h
  71. @@ -1455,6 +1455,8 @@
  72. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
  73. { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
  74. { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
  75. +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
  76. +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
  77. { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
  78. { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
  79. { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
  80. --
  81. 2.1.4
  82.  
  83.  
  84. From b59919e7768b38a08c890f125039adf2e54d65f8 Mon Sep 17 00:00:00 2001
  85. From: Marchuk Nikolay <n1kolasM@users.noreply.github.com>
  86. Date: Thu, 16 Mar 2017 17:52:21 +0700
  87. Subject: [PATCH 2/2] Implemented parser for NS_* ioctl commands.
  88.  
  89. Signed-off-by: Marchuk Nikolay <n1kolasM@users.noreply.github.com>
  90. ---
  91. Makefile.am | 1 +
  92. configure.ac | 1 +
  93. defs.h | 1 +
  94. ioctl.c | 4 ++
  95. nsfs.c | 85 ++++++++++++++++++++++++++++++++
  96. tests/.gitignore | 1 +
  97. tests/Makefile.am | 2 +
  98. tests/ioctl_nsfs.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++
  99. tests/ioctl_nsfs.test | 13 +++++
  100. 9 files changed, 240 insertions(+)
  101. create mode 100644 nsfs.c
  102. create mode 100644 tests/ioctl_nsfs.c
  103. create mode 100644 tests/ioctl_nsfs.test
  104.  
  105. diff --git a/Makefile.am b/Makefile.am
  106. index c77f463..338fb62 100644
  107. --- a/Makefile.am
  108. +++ b/Makefile.am
  109. @@ -172,6 +172,7 @@ strace_SOURCES = \
  110. net.c \
  111. netlink.c \
  112. nsig.h \
  113. + nsfs.c \
  114. numa.c \
  115. oldstat.c \
  116. open.c \
  117. diff --git a/configure.ac b/configure.ac
  118. index 9e5087b..dc49fdc 100644
  119. --- a/configure.ac
  120. +++ b/configure.ac
  121. @@ -366,6 +366,7 @@ AC_CHECK_HEADERS(m4_normalize([
  122. linux/ipc.h
  123. linux/mmtimer.h
  124. linux/msg.h
  125. + linux/nsfs.h
  126. linux/perf_event.h
  127. linux/quota.h
  128. linux/seccomp.h
  129. diff --git a/defs.h b/defs.h
  130. index 793971e..0f3ec14 100644
  131. --- a/defs.h
  132. +++ b/defs.h
  133. @@ -640,6 +640,7 @@ name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg)
  134. DECL_IOCTL(dm);
  135. DECL_IOCTL(file);
  136. DECL_IOCTL(fs_x);
  137. +DECL_IOCTL(nsfs);
  138. DECL_IOCTL(ptp);
  139. DECL_IOCTL(scsi);
  140. DECL_IOCTL(term);
  141. diff --git a/ioctl.c b/ioctl.c
  142. index aa1880f..d972c38 100644
  143. --- a/ioctl.c
  144. +++ b/ioctl.c
  145. @@ -280,6 +280,10 @@ ioctl_decode(struct tcb *tcp)
  146. case 0x94:
  147. return btrfs_ioctl(tcp, code, arg);
  148. #endif
  149. +#ifdef HAVE_LINUX_NSFS_H
  150. + case 0xb7:
  151. + return nsfs_ioctl(tcp, code, arg);
  152. +#endif
  153. #ifdef HAVE_LINUX_DM_IOCTL_H
  154. case 0xfd:
  155. return dm_ioctl(tcp, code, arg);
  156. diff --git a/nsfs.c b/nsfs.c
  157. new file mode 100644
  158. index 0000000..68c8e46
  159. --- /dev/null
  160. +++ b/nsfs.c
  161. @@ -0,0 +1,85 @@
  162. +/*
  163. + * Support for decoding of NS_* ioctl commands.
  164. + *
  165. + * Copyright (c) 2017 Nikolay Marchuk <marchuk.nikolay.a@gmail.com>
  166. + * All rights reserved.
  167. + *
  168. + * Redistribution and use in source and binary forms, with or without
  169. + * modification, are permitted provided that the following conditions
  170. + * are met:
  171. + * 1. Redistributions of source code must retain the above copyright
  172. + * notice, this list of conditions and the following disclaimer.
  173. + * 2. Redistributions in binary form must reproduce the above copyright
  174. + * notice, this list of conditions and the following disclaimer in the
  175. + * documentation and/or other materials provided with the distribution.
  176. + * 3. The name of the author may not be used to endorse or promote products
  177. + * derived from this software without specific prior written permission.
  178. + *
  179. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  180. + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  181. + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  182. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  183. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  184. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  185. + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  186. + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  187. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  188. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  189. + */
  190. +
  191. +#include "defs.h"
  192. +
  193. +#ifdef HAVE_LINUX_NSFS_H
  194. +
  195. +# include "xlat/setns_types.h"
  196. +# include <linux/ioctl.h>
  197. +# include <linux/nsfs.h>
  198. +# include <sys/types.h>
  199. +
  200. +/* Definitions for command which have been added later */
  201. +# ifndef NS_GET_NSTYPE
  202. +# define NS_GET_NSTYPE _IO(NSIO, 0x3)
  203. +# endif
  204. +# ifndef NS_GET_OWNER_UID
  205. +# define NS_GET_OWNER_UID _IO(NSIO, 0x4)
  206. +# endif
  207. +
  208. +int
  209. +nsfs_ioctl(struct tcb * tcp, unsigned int code, kernel_ulong_t arg){
  210. + char *outstr;
  211. + uid_t uid;
  212. + if(entering(tcp)) {
  213. + switch(code) {
  214. + case NS_GET_USERNS:
  215. + case NS_GET_PARENT:
  216. + return RVAL_DECODED | (1 + RVAL_FD);
  217. + case NS_GET_OWNER_UID:
  218. + if (!umove(tcp, arg, &uid)) {
  219. + tprintf(", ");
  220. + printaddr(&uid);
  221. + return RVAL_DECODED | 1;
  222. + }
  223. + default:
  224. + return 0;
  225. + }
  226. + } else {
  227. + switch(code) {
  228. + case NS_GET_NSTYPE:
  229. + if (!syserror(tcp)) {
  230. + outstr = xlookup(setns_types, tcp->u_rval);
  231. + if (outstr) {
  232. + tcp->auxstr = outstr;
  233. + return RVAL_STR;
  234. + }
  235. + }
  236. + return 0;
  237. + case NS_GET_OWNER_UID:
  238. + if (!syserror(tcp) && !umove(tcp, arg, &uid)) {
  239. + printuid(", uid = ", uid);
  240. + }
  241. + default:
  242. + return 0;
  243. + }
  244. + }
  245. +}
  246. +#endif /* HAVE_LINUX_NSFS_H */
  247. diff --git a/tests/.gitignore b/tests/.gitignore
  248. index a7754b6..060a391 100644
  249. --- a/tests/.gitignore
  250. +++ b/tests/.gitignore
  251. @@ -121,6 +121,7 @@ ioctl_loop
  252. ioctl_loop-nv
  253. ioctl_loop-v
  254. ioctl_mtd
  255. +ioctl_nsfs
  256. ioctl_rtc
  257. ioctl_rtc-v
  258. ioctl_scsi
  259. diff --git a/tests/Makefile.am b/tests/Makefile.am
  260. index c5c124c..bc0c621 100644
  261. --- a/tests/Makefile.am
  262. +++ b/tests/Makefile.am
  263. @@ -184,6 +184,7 @@ check_PROGRAMS = \
  264. ioctl_loop-nv \
  265. ioctl_loop-v \
  266. ioctl_mtd \
  267. + ioctl_nsfs \
  268. ioctl_rtc \
  269. ioctl_rtc-v \
  270. ioctl_scsi \
  271. @@ -593,6 +594,7 @@ DECODER_TESTS = \
  272. ioctl_loop-v.test \
  273. ioctl_loop.test \
  274. ioctl_mtd.test \
  275. + ioctl_nsfs.test \
  276. ioctl_rtc-v.test \
  277. ioctl_rtc.test \
  278. ioctl_scsi.test \
  279. diff --git a/tests/ioctl_nsfs.c b/tests/ioctl_nsfs.c
  280. new file mode 100644
  281. index 0000000..3ee682d
  282. --- /dev/null
  283. +++ b/tests/ioctl_nsfs.c
  284. @@ -0,0 +1,132 @@
  285. +/*
  286. + * Check decoding of NS_* commands of ioctl syscall.
  287. + *
  288. + * Copyright (c) 2017 Nikolay Marchuk <marchuk.nikolay.a@gmail.com>
  289. + * All rights reserved.
  290. + *
  291. + * Redistribution and use in source and binary forms, with or without
  292. + * modification, are permitted provided that the following conditions
  293. + * are met:
  294. + * 1. Redistributions of source code must retain the above copyright
  295. + * notice, this list of conditions and the following disclaimer.
  296. + * 2. Redistributions in binary form must reproduce the above copyright
  297. + * notice, this list of conditions and the following disclaimer in the
  298. + * documentation and/or other materials provided with the distribution.
  299. + * 3. The name of the author may not be used to endorse or promote products
  300. + * derived from this software without specific prior written permission.
  301. + *
  302. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  303. + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  304. + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  305. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  306. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  307. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  308. + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  309. + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  310. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  311. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  312. + */
  313. +
  314. +#include "tests.h"
  315. +
  316. +#ifdef HAVE_LINUX_NSFS_H
  317. +
  318. +# include <linux/ioctl.h>
  319. +# include <linux/nsfs.h>
  320. +# include <sched.h>
  321. +# include <stdio.h>
  322. +# include <stdlib.h>
  323. +# include <sys/ioctl.h>
  324. +# include <sys/types.h>
  325. +# include <sys/wait.h>
  326. +# include <unistd.h>
  327. +
  328. +/* Definitions for command which have been added later */
  329. +# ifndef NS_GET_NSTYPE
  330. +# define NS_GET_NSTYPE _IO(NSIO, 0x3)
  331. +# endif
  332. +# ifndef NS_GET_OWNER_UID
  333. +# define NS_GET_OWNER_UID _IO(NSIO, 0x4)
  334. +# endif
  335. +
  336. +# define STACK_SIZE 4096
  337. +
  338. +static void
  339. +test_no_namespace(void)
  340. +{
  341. + ioctl(-1, NS_GET_USERNS);
  342. + printf("ioctl(-1, NS_GET_USERNS) = -1 EBADF (%m)\n");
  343. + ioctl(-1, NS_GET_PARENT);
  344. + printf("ioctl(-1, NS_GET_PARENT) = -1 EBADF (%m)\n");
  345. + ioctl(-1, NS_GET_NSTYPE, NULL);
  346. + printf("ioctl(-1, NS_GET_NSTYPE, 0) = -1 EBADF (%m)\n");
  347. + ioctl(-1, NS_GET_OWNER_UID, NULL);
  348. + printf("ioctl(-1, NS_GET_OWNER_UID, NULL) = -1 EBADF (%m)\n");
  349. +}
  350. +
  351. +static int
  352. +test_child(void *arg)
  353. +{
  354. + int ns_fd, userns_fd, parent_ns_fd, nstype, rc;
  355. + uid_t uid;
  356. + ns_fd = STDIN_FILENO;
  357. +
  358. + userns_fd = ioctl(ns_fd, NS_GET_USERNS);
  359. + printf("ioctl(%d, NS_GET_USERNS) = %s\n", ns_fd, sprintrc(userns_fd));
  360. +
  361. + parent_ns_fd = ioctl(userns_fd, NS_GET_PARENT);
  362. + printf("ioctl(%d, NS_GET_PARENT) = %s\n", userns_fd, sprintrc(parent_ns_fd));
  363. +
  364. + nstype = ioctl(userns_fd, NS_GET_NSTYPE);
  365. + if (nstype == CLONE_NEWUSER) {
  366. + printf("ioctl(%d, NS_GET_NSTYPE, 0) = CLONE_NEWUSER\n", userns_fd);
  367. + } else {
  368. + printf("ioctl(%d, NS_GET_NSTYPE, 0) = %s\n", userns_fd, sprintrc(nstype));
  369. + }
  370. +
  371. + rc = ioctl(userns_fd, NS_GET_OWNER_UID, &uid);
  372. + if (rc == -1) {
  373. + printf("ioctl(%d, NS_GET_OWNER_UID, %p) = %s\n", userns_fd, &uid, sprintrc(rc));
  374. + } else {
  375. + printf("ioctl(%d, NS_GET_OWNER_UID, %p, uid = ", userns_fd, &uid);
  376. + if ((uid_t) -1U == (uid_t) uid)
  377. + printf("-1) = %s\n", sprintrc(rc));
  378. + else
  379. + printf("%u) = %s\n", uid, sprintrc(rc));
  380. + }
  381. +
  382. + return 0;
  383. +}
  384. +
  385. +static void
  386. +test_user_namespace(void)
  387. +{
  388. + char *stack;
  389. + char *stack_top;
  390. + pid_t pid;
  391. + stack = malloc(STACK_SIZE);
  392. + if (stack == NULL)
  393. + error_msg_and_skip("Malloc");
  394. + stack_top = stack + STACK_SIZE;
  395. + pid = clone(test_child, stack_top, CLONE_NEWUSER | CLONE_FILES | SIGCHLD, NULL);
  396. + if (pid == -1) {
  397. + error_msg_and_skip("Clone");
  398. + }
  399. + if (waitpid(pid, NULL, 0) == -1)
  400. + error_msg_and_skip("Waitpid");
  401. +}
  402. +
  403. +int
  404. +main(void)
  405. +{
  406. + test_no_namespace();
  407. + test_user_namespace();
  408. + puts("+++ exited with 0 +++");
  409. + return 0;
  410. +}
  411. +
  412. +#else /* !HAVE_LINUX_DM_IOCTL_H */
  413. +
  414. +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NSFS_H")
  415. +
  416. +#endif /* HAVE_LINUX_DM_IOCTL_H */
  417. diff --git a/tests/ioctl_nsfs.test b/tests/ioctl_nsfs.test
  418. new file mode 100644
  419. index 0000000..548242a
  420. --- /dev/null
  421. +++ b/tests/ioctl_nsfs.test
  422. @@ -0,0 +1,13 @@
  423. +#!/bin/sh
  424. +
  425. +# Check decoding of NS_* ioctls.
  426. +
  427. +. "${srcdir=.}/init.sh"
  428. +
  429. +run_prog > /dev/null
  430. +run_strace -a16 -eioctl -f -q $args > "$EXP"
  431. +check_prog grep
  432. +grep -v '^ioctl([012],' < "$LOG" > "$OUT"
  433. +match_diff "$OUT" "$EXP"
  434. +
  435. +rm -f "$EXP" "$OUT"
  436. --
  437. 2.1.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement