Linux Container Development
 help / color / mirror / Atom feed
* [RFC user-cr PATCH] mktree: handle CKPT_HDR_LSM_INFO header type
@ 2009-09-03 22:37 Serge E. Hallyn
  0 siblings, 0 replies; only message in thread
From: Serge E. Hallyn @ 2009-09-03 22:37 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers, Casey Schaufler

[ This patch is against the userspace c/r code at
git://git.ncl.cs.columbia.edu/pub/git/user-cr.git ]

This is a variable length buffer type intended to contain
LSM-specific version information, for instance a policy
version number of sha1sum of the policy.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 mktree.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/mktree.c b/mktree.c
index a9fb9c4..3785ebc 100644
--- a/mktree.c
+++ b/mktree.c
@@ -1751,6 +1751,11 @@ static int ckpt_read_header(struct ckpt_ctx *ctx)
 	if (ret < 0)
 		return ret;
 
+	ptr += ((struct ckpt_hdr *) ptr)->len;
+	ret = ckpt_read_obj_type(ctx, ptr, 200, CKPT_HDR_LSM_INFO);
+	if (ret < 0)
+		return ret;
+
 	/* FIXME: skip version validation for now */
 
 	return 0;
@@ -1833,6 +1838,11 @@ static int ckpt_write_header(struct ckpt_ctx *ctx)
 		return ret;
 	ptr += ((struct ckpt_hdr *) ptr)->len;
 	ret = ckpt_write_obj(ctx, (struct ckpt_hdr *) ptr);
+	if (ret < 0)
+		return ret;
+
+	ptr += ((struct ckpt_hdr *) ptr)->len;
+	ret = ckpt_write_obj(ctx, (struct ckpt_hdr *) ptr);
 
 	return ret;
 }
-- 
1.6.1.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-03 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03 22:37 [RFC user-cr PATCH] mktree: handle CKPT_HDR_LSM_INFO header type Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox