Miklos Szeredi
2f4d4503e9
statmount: add flag to retrieve unescaped options
...
Filesystem options can be retrieved with STATMOUNT_MNT_OPTS, which
returns a string of comma separated options, where some characters are
escaped using the \OOO notation.
Add a new flag, STATMOUNT_OPT_ARRAY, which instead returns the raw
option values separated with '\0' charaters.
Since escaped charaters are rare, this inteface is preferable for
non-libmount users which likley don't want to deal with option
de-escaping.
Example code:
if (st->mask & STATMOUNT_OPT_ARRAY) {
const char *opt = st->str + st->opt_array;
for (unsigned int i = 0; i < st->opt_num; i++) {
printf("opt_array[%i]: <%s>\n", i, opt);
opt += strlen(opt) + 1;
}
}
Example ouput:
(1) mnt_opts: <lowerdir+=/l\054w\054r,lowerdir+=/l\054w\054r1,upperdir=/upp\054r,workdir=/w\054rk,redirect_dir=nofollow,uuid=null>
(2) opt_array[0]: <lowerdir+=/l,w,r>
opt_array[1]: <lowerdir+=/l,w,r1>
opt_array[2]: <upperdir=/upp,r>
opt_array[3]: <workdir=/w,rk>
opt_array[4]: <redirect_dir=nofollow>
opt_array[5]: <uuid=null>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com >
Link: https://lore.kernel.org/r/20241112101006.30715-1-mszeredi@redhat.com
Acked-by: Jeff Layton <jlayton@kernel.org >
[brauner: tweak variable naming and parsing add example output]
Signed-off-by: Christian Brauner <brauner@kernel.org >
2024-11-13 17:27:02 +01:00
..
2024-09-12 12:20:41 +02:00
2024-08-07 11:33:21 +02:00
2024-09-16 13:07:59 +02:00
2024-09-12 12:20:41 +02:00
2024-08-30 08:22:36 +02:00
2024-09-29 09:17:44 -07:00
2024-05-31 12:31:39 +02:00
2024-08-07 11:33:21 +02:00
2024-10-28 13:26:54 +01:00
2024-09-12 12:20:41 +02:00
2024-09-28 08:40:36 -07:00
2024-08-19 13:45:03 +02:00
2024-06-17 20:42:57 +02:00
2024-07-15 11:14:59 -07:00
2024-05-19 09:21:03 -07:00
2024-09-27 08:18:43 -07:00
2024-09-27 08:18:43 -07:00
2024-08-07 11:33:21 +02:00
2024-09-27 08:18:43 -07:00
2024-07-15 11:14:59 -07:00
2024-09-12 23:00:09 +08:00
2024-09-23 21:38:13 +09:00
2024-05-28 15:57:23 +02:00
2024-09-16 09:14:02 +02:00
2024-10-28 13:26:54 +01:00
2024-10-28 13:26:54 +01:00
2024-08-07 11:33:21 +02:00
2024-11-06 10:42:06 +01:00
2024-09-27 08:18:43 -07:00
2024-10-02 07:52:07 +02:00
2024-08-07 11:33:21 +02:00
2024-11-12 14:36:45 +01:00
2024-08-07 11:33:21 +02:00
2024-08-07 11:33:21 +02:00
2024-10-02 07:52:11 +02:00
2024-10-28 13:26:54 +01:00
2024-09-02 15:52:56 +02:00
2024-08-26 23:49:15 -04:00
2024-08-19 13:40:00 +02:00
2024-09-19 06:38:43 +02:00
2024-05-04 19:02:39 +02:00
2024-10-02 07:52:07 +02:00
2024-08-07 11:33:36 +02:00
2024-09-26 17:45:20 -05:00
2024-09-24 15:44:18 -07:00
2024-09-23 15:03:30 -04:00
2024-10-02 07:52:07 +02:00
2024-09-21 08:20:50 -07:00
2024-06-03 16:37:07 +02:00
2024-09-23 09:35:36 -07:00
2024-08-07 11:33:21 +02:00
2024-10-02 07:52:07 +02:00
2024-08-07 11:33:21 +02:00
2024-06-20 09:46:01 +02:00
2024-09-20 19:34:00 -07:00
2024-09-27 12:38:47 -07:00
2024-09-24 11:08:40 -07:00
2024-09-19 10:18:15 +02:00
2024-05-28 11:52:53 +02:00
2024-08-07 11:31:56 +02:00
2024-09-23 10:49:28 -07:00
2024-04-25 20:56:25 -07:00
2024-08-07 11:33:36 +02:00
2024-08-21 22:32:58 +02:00
2024-09-28 08:35:21 -07:00
2024-09-21 08:20:50 -07:00
2024-04-23 13:27:43 +02:00
2024-08-07 11:33:36 +02:00
2024-07-22 18:25:47 -07:00
2024-09-05 10:18:48 -04:00
2024-09-27 08:18:43 -07:00
2024-09-16 09:14:02 +02:00
2024-09-16 09:14:02 +02:00
2024-06-20 19:30:02 -04:00
2024-08-07 11:32:02 +02:00
2024-08-20 14:03:18 -04:00
2024-09-23 09:35:36 -07:00
2024-09-03 15:01:23 +02:00
2024-11-12 14:36:45 +01:00
2024-04-26 10:33:05 +02:00
2024-08-29 06:20:44 +12:00
2024-08-23 13:08:31 +02:00
2024-08-26 13:00:38 -07:00
2024-09-26 11:39:02 -07:00
2024-08-09 20:19:00 -07:00
2024-07-15 11:14:59 -07:00
2024-05-28 12:06:51 +02:00
2024-08-07 11:26:54 -07:00
2024-10-28 13:26:54 +01:00
2024-10-22 11:16:57 +02:00
2024-10-22 11:16:58 +02:00
2024-04-25 20:56:20 -07:00
2024-10-22 11:16:57 +02:00
2024-08-19 13:45:02 +02:00
2024-07-24 20:59:29 +02:00
2024-08-12 22:00:43 -04:00
2024-10-22 11:16:59 +02:00
2024-09-21 07:29:05 -07:00
2024-10-22 11:16:58 +02:00
2024-09-23 09:35:36 -07:00
2024-09-18 08:53:53 +02:00
2024-09-23 09:35:36 -07:00
2024-10-02 07:52:33 +02:00
2024-11-13 14:08:34 +01:00
2024-09-27 08:18:43 -07:00
2024-10-22 11:16:58 +02:00
2024-08-28 13:05:39 +02:00
2024-08-12 22:00:43 -04:00
2024-09-24 15:44:18 -07:00
2024-06-19 13:13:55 -07:00
2024-08-12 22:00:43 -04:00
2024-09-16 08:54:30 +02:00
2024-09-23 09:35:36 -07:00
2024-08-06 09:01:41 -07:00
2024-09-24 15:29:42 -07:00
2024-09-16 11:15:26 +02:00
2024-10-28 13:26:54 +01:00
2024-11-01 14:12:34 +01:00
2024-11-13 17:27:02 +01:00
2024-09-27 08:18:43 -07:00
2024-09-23 09:35:36 -07:00
2024-07-24 10:53:13 +02:00
2024-09-27 08:18:43 -07:00
2024-10-22 11:16:59 +02:00
2024-06-28 14:36:43 +02:00
2024-09-23 09:35:36 -07:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-09-23 09:35:36 -07:00
2024-10-22 11:16:57 +02:00
2024-09-23 09:35:36 -07:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-09-16 08:35:09 +02:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00
2024-09-01 20:25:57 -07:00
2024-08-12 22:00:43 -04:00
2024-08-12 22:00:43 -04:00