From ae24e7d34afe3d68226e0821c480a5051931bccb Mon Sep 17 00:00:00 2001
From: Alex Tsariounov
Date: Thu, 9 Jun 2011 13:20:23 -0400
Subject: [PATCH] Fix for Issue #5 (LOGNAME not set on exec with --user
parameter) Also updated dates and some incorrect texts.
---
INSTALL | 2 +-
NEWS | 11 +++++++++++
README | 2 +-
cpuset.spec | 2 +-
cpuset/commands/proc.py | 5 ++++-
cpuset/version.py | 2 +-
cset.init.d | 16 ++++++++--------
doc/cset-proc.1 | 6 +++---
doc/cset-proc.html | 6 +++---
doc/cset-proc.txt | 4 ++--
doc/cset-set.1 | 6 +++---
doc/cset-set.html | 6 +++---
doc/cset-set.txt | 4 ++--
doc/cset-shield.1 | 6 +++---
doc/cset-shield.html | 6 +++---
doc/cset-shield.txt | 4 ++--
doc/cset.1 | 6 +++---
doc/cset.html | 6 +++---
doc/cset.txt | 4 ++--
doc/tutorial.html | 4 ++--
doc/tutorial.txt | 2 +-
21 files changed, 62 insertions(+), 48 deletions(-)
diff --git a/INSTALL b/INSTALL
index 01a5bcf..1363a06 100644
--- a/INSTALL
+++ b/INSTALL
@@ -26,6 +26,6 @@ For more information:
Prebuild Binary Packages
========================
Alternatively, you may download pre-built binary packages for multiple
-distributions from the OpenSUSE Build Service here:
+distributions from the Open Build Service here:
http://download.opensuse.org/repositories/home:/tsariounov:/cpuset
diff --git a/NEWS b/NEWS
index 65857a0..7c3f638 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+============================================================
+Cpuset 1.5.6 (June 9, 2011)
+http://code.google.com/p/cpuset
+http://download.opensuse.org/repositories/home:/tsariounov:/cpuset/
+
+Maintenance update to 1.5.5 includes fixes as follows.
+
+* Fix for Issue#5: LOGNAME environment variable set incorrectly...
+ Set LOGNAME and USERNAME env variables when execing new process
+ to match --user option, if given.
+
============================================================
Cpuset 1.5.5 (August 3, 2010)
http://code.google.com/p/cpuset
diff --git a/README b/README
index 2711eaf..4ca4f8e 100644
--- a/README
+++ b/README
@@ -15,7 +15,7 @@ Bugs or feature requests should be sent to:
-----
-Copyright (C) 2008-2010 Novell Inc.
+Copyright (C) 2008-2011 Novell Inc.
Author: Alex Tsariounov
diff --git a/cpuset.spec b/cpuset.spec
index 2c83474..86c8388 100644
--- a/cpuset.spec
+++ b/cpuset.spec
@@ -16,7 +16,7 @@
# norootforbuild
Name: cpuset
-Version: 1.5.5
+Version: 1.5.6
Release: 1
License: GPL v2 only
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff --git a/cpuset/commands/proc.py b/cpuset/commands/proc.py
index 41a246d..353292f 100644
--- a/cpuset/commands/proc.py
+++ b/cpuset/commands/proc.py
@@ -565,7 +565,10 @@ def run(tset, args, usr_par=None, grp_par=None):
s.path, os.getpid())
# change user and group before exec
if grp_par: os.setgid(group)
- if usr_par: os.setuid(user)
+ if usr_par:
+ os.setuid(user)
+ os.environ["LOGNAME"] = usr_par
+ os.environ["USERNAME"] = usr_par
os.execvp(args[0], args)
def is_unbound(proc):
diff --git a/cpuset/version.py b/cpuset/version.py
index 8078766..9b20cfc 100644
--- a/cpuset/version.py
+++ b/cpuset/version.py
@@ -16,4 +16,4 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
-version = '1.5.5'
+version = '1.5.6'
diff --git a/cset.init.d b/cset.init.d
index 76c838c..b42a529 100755
--- a/cset.init.d
+++ b/cset.init.d
@@ -51,12 +51,12 @@ test -x $CSET_BIN || { echo "$CSET_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
-# cset variables
+# cset variables (EDIT apropriately for your situation)
CSET_SYSTEM=0
CSET_USER=1-7
-# Check for existence of needed config file and read it
-# This is not used for this example, but you can create one for
+# Check for existence of cset config file and read it
+# This is not used in this example, but you can create one for
# your setup if you wish.
#CSET_CONFIG=/etc/sysconfig/cset
#test -r $CSET_CONFIG || { echo "$CSET_CONFIG not existing";
@@ -86,16 +86,16 @@ case "$1" in
#### Example 1: using the shield subcommand
##
- #$CSET_BIN shield --cpu=0
+ #$CSET_BIN shield --cpu=1-3
# Note that this creates CPU 0 as the general processor that runs
- # everything and all other CPUs are assigned to the shield. This
- # is a typical simple shielding setup. Adjust if your needs are
- # different.
+ # everything and all other CPUs (assuming this is a 4-CPU system) are assigned
+ # to the shield. This is a typical simple shielding setup. Adjust if your
+ # needs are different.
# For shielding kernel threads as well, use the -k switch below instead
# of the shield command above.
- #$CSET_BIN shield --cpu=0 -k
+ #$CSET_BIN shield --cpu=1-3 -k
##
#### Example 2: using the set and proc subcommands
diff --git a/doc/cset-proc.1 b/doc/cset-proc.1
index 320a985..10a6bbf 100644
--- a/doc/cset-proc.1
+++ b/doc/cset-proc.1
@@ -2,12 +2,12 @@
.\" Title: cset-proc
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2
-.\" Date: 02/11/2010
+.\" Date: 06/09/2011
.\" Manual: [FIXME: manual]
.\" Source: [FIXME: source]
.\" Language: English
.\"
-.TH "CSET\-PROC" "1" "02/11/2010" "[FIXME: source]" "[FIXME: manual]"
+.TH "CSET\-PROC" "1" "06/09/2011" "[FIXME: source]" "[FIXME: manual]"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -258,7 +258,7 @@ You do not have to worry about where in the Linux filesystem the cpuset filesyst
.SH "LICENSE"
Cpuset is licensed under the GNU GPL V2 only\&.
.SH "COPYRIGHT"
-Copyright (c) 2008\-2010 Novell Inc\&.
+Copyright (c) 2008\-2011 Novell Inc\&.
.SH "AUTHOR"
Written by Alex Tsariounov \&.
.SH "SEE ALSO"
diff --git a/doc/cset-proc.html b/doc/cset-proc.html
index a8c4720..b0d3d18 100644
--- a/doc/cset-proc.html
+++ b/doc/cset-proc.html
@@ -685,7 +685,7 @@ respect to the root of the cpuset filesystem.
COPYRIGHT
-
Copyright (c) 2008-2010 Novell Inc.
+
Copyright (c) 2008-2011 Novell Inc.
AUTHOR
@@ -700,8 +700,8 @@ respect to the root of the cpuset filesystem.