Include upstream patch to get correct directory setgid/sticky bits in the appliance.

This commit is contained in:
Richard W.M. Jones 2013-08-06 09:12:48 +01:00
parent 86052d0d14
commit 2f66d09178
2 changed files with 59 additions and 4 deletions

View File

@ -0,0 +1,47 @@
From 417439cbbd3fff062a6aedce78dbaf49f6bd7e75 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 5 Aug 2013 21:18:59 +0100
Subject: [PATCH] Copy sticky & setgid bits from directory to base.img, and
into appliance.
These bits are copied from the original directory mode (from the RPM)
to the base.img, and from there into the appliance.
S_ISGID 0002000 set-group-ID bit (see below)
S_ISVTX 0001000 sticky bit (see below)
These bits have special significance for some directories (eg. /tmp).
---
helper/ext2.c | 2 +-
src/supermin.ml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/helper/ext2.c b/helper/ext2.c
index 438713a..2d75fb2 100644
--- a/helper/ext2.c
+++ b/helper/ext2.c
@@ -132,7 +132,7 @@ ext2_mkdir (ext2_ino_t dir_ino, const char *dirname, const char *basename,
{
errcode_t err;
- mode = LINUX_S_IFDIR | (mode & 0777);
+ mode = LINUX_S_IFDIR | (mode & 03777);
/* Does the directory exist? This is legitimate: we just skip
* this case.
diff --git a/src/supermin.ml b/src/supermin.ml
index 251c13e..995f9d8 100644
--- a/src/supermin.ml
+++ b/src/supermin.ml
@@ -379,7 +379,7 @@ let () =
*)
List.iter (
fun (path, { ft_dir = is_dir; ft_mode = mode }, _) ->
- if is_dir then chmod (rootdir // path) (mode land 0o777 lor 0o700)
+ if is_dir then chmod (rootdir // path) (mode land 0o3777 lor 0o700)
) (List.rev baseimgfiles);
(* Construct the 'base.img' initramfs. Feed in the list of filenames
--
1.8.3.1

View File

@ -1,16 +1,18 @@
Summary: Tool for creating supermin appliances
Name: supermin
Version: 4.1.2
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
URL: http://people.redhat.com/~rjones/supermin/
Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz
%if 0%{?rhel} >= 7
ExclusiveArch: x86_64
%endif
URL: http://people.redhat.com/~rjones/supermin/
Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz
Patch0: 0001-Copy-sticky-setgid-bits-from-directory-to-base.img-a.patch
BuildRequires: /usr/bin/pod2man
BuildRequires: yum >= 3.2
BuildRequires: /usr/sbin/mke2fs
@ -61,6 +63,8 @@ Obsoletes: febootstrap-supermin-helper <= 3.21-1
%prep
%setup -q
%patch0 -p1
%build
%configure --disable-network-tests
@ -95,6 +99,10 @@ make check
%changelog
* Tue Aug 6 2013 Richard W.M. Jones <rjones@redhat.com> - 4.1.2-2
- Include upstream patch to get correct directory setgid/sticky bits in
the appliance.
* Sat Aug 3 2013 Richard W.M. Jones <rjones@redhat.com> - 4.1.2-1
- New upstream version 4.1.2.
- Remove patch which is now upstream.