public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: fabbione@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 ./WHATS_NEW scripts/clvmd_init_red_hat.in
Date: Thu, 12 Aug 2010 09:15:00 -0000	[thread overview]
Message-ID: <20100812091501.3960.qmail@sourceware.org> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	fabbione@sourceware.org	2010-08-12 09:15:00

Modified files:
	.              : WHATS_NEW 
	scripts        : clvmd_init_red_hat.in 

Log message:
	Fix clvmd init script return code when executed as non-root user.
	
	clvmd daemon itself does the right thing when invoked as non-root, by
	returning 4.
	
	The patch removes the use daemon function from
	/etc/rc.d/init.d/functions that´s unnecessary and has th bad habit to
	mask the return codes from the real daemon.
	
	Add a simple and generic check to see if clvmd is executed by root or not.
	
	Our stop/reload/restart paths in the init script are complex and not all
	the tools involved in the process are guaranteed to return 4 if executed
	by non-root against a process that´s running as root (for example kill
	-TERM will return -1 and parsing the output to catch the error is
	suboptimal at best).
	
	https://bugzilla.redhat.com/show_bug.cgi?id=553381

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1701&r2=1.1702
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/clvmd_init_red_hat.in.diff?cvsroot=lvm2&r1=1.9&r2=1.10

--- LVM2/WHATS_NEW	2010/08/12 04:11:48	1.1701
+++ LVM2/WHATS_NEW	2010/08/12 09:14:59	1.1702
@@ -1,5 +1,6 @@
 Version 2.02.73 - 
 ================================
+  Fix clvmd init script exit code when executed as non-root user.
   Change default alignment of pe_start to 1MB.
   Add --norestorefile option to pvcreate.
   Require --restorefile when using pvcreate --uuid.
--- LVM2/scripts/clvmd_init_red_hat.in	2010/06/23 16:24:14	1.9
+++ LVM2/scripts/clvmd_init_red_hat.in	2010/08/12 09:15:00	1.10
@@ -66,7 +66,7 @@
 {
 	if ! rh_status_q; then
 		echo -n "Starting $DAEMON: "
-		daemon $DAEMON $CLVMDOPTS || return $?
+		$DAEMON $CLVMDOPTS || return $?
 		echo
 	fi
 
@@ -165,6 +165,11 @@
 	fi
 }
 
+[ "$EUID" != "0" ] && {
+	echo "clvmd init script can only be executed as root user"
+	exit 4
+}
+
 # See how we were called.
 case "$1" in
   start)


             reply	other threads:[~2010-08-12  9:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12  9:15 fabbione [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-23 16:24 mbroz
2010-06-03 21:03 mbroz
2010-05-17  3:18 fabbione
2010-02-26 13:07 fabbione
2009-05-29 18:34 snitzer
2009-02-10 11:53 ccaulfield

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=20100812091501.3960.qmail@sourceware.org \
    --to=fabbione@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).