[debian-edu-commits] debian-edu/ 15/31: * Rewrite patch x-console to drop code to use uid instead of username for console users. It was based on a misunderstanding regarding the source of the uids. * New patch linux-ps-longusernames to look up uids returned from ps to get the usernames, to work around the misfeature in ps only showing uids for users with usernames > 8 characters.
Alexander Alemayhu
ccscanf-guest at moszumanska.debian.org
Tue Jun 10 23:27:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
ccscanf-guest pushed a commit to branch master
in repository killer.
commit 5a3a52379a11c3e62e857c50d49e769f03450971
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Sat Jul 5 23:25:09 2008 +0000
* Rewrite patch x-console to drop code to use uid instead of username
for console users. It was based on a misunderstanding regarding the
source of the uids.
* New patch linux-ps-longusernames to look up uids returned from ps to
get the usernames, to work around the misfeature in ps only showing
uids for users with usernames > 8 characters.
---
debian/changelog | 11 +++++++++++
debian/patches/00list | 1 +
debian/patches/linux-ps-longusernames.dpatch | 22 ++++++++++++++++++++++
debian/patches/x-console.dpatch | 7 ++-----
4 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f1ad077..faf4e55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+killer (0.90-5) UNRELEASED; urgency=low
+
+ * Rewrite patch x-console to drop code to use uid instead of username
+ for console users. It was based on a misunderstanding regarding the
+ source of the uids.
+ * New patch linux-ps-longusernames to look up uids returned from ps to
+ get the usernames, to work around the misfeature in ps only showing
+ uids for users with usernames > 8 characters.
+
+ -- Petter Reinholdtsen <pere at debian.org> Sun, 6 Jul 2008 01:23:22 +0200
+
killer (0.90-4) unstable; urgency=low
[ José L. Redrejo Rodríguez ]
diff --git a/debian/patches/00list b/debian/patches/00list
index 013cb33..06231c1 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -9,3 +9,4 @@ console-devs
linux-nice-level
default-email
update-valid-users
+linux-ps-longusernames
diff --git a/debian/patches/linux-ps-longusernames.dpatch b/debian/patches/linux-ps-longusernames.dpatch
new file mode 100755
index 0000000..3d32209
--- /dev/null
+++ b/debian/patches/linux-ps-longusernames.dpatch
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+
+Improve handling of long usernames on Linux, where ps will print the
+uid if the username is more than 8 characters logn.
+ - Petter Reinholdtsen 2008-07-06
+
+ at DPATCH@
+diff -urNad killer~/killer killer/killer
+--- killer~/killer 2008-07-06 01:20:55.000000000 +0200
++++ killer/killer 2008-07-06 01:20:55.000000000 +0200
+@@ -238,7 +238,10 @@
+
+ ($user, $ruser, $uid, $ruid, $tty, $pid, $ppid, $nice, $comm)
+ = split( /[ \t]+/, $_, 9 );
+-
++
++ # Linux ps report uid when username is longer than 8 characters.
++ $user = (getpwuid($user))[1] if ($user =~ m/^\d+/);
++
+ $pid2user{$pid} = $user;
+ $pid2ruser{$pid} = $ruser;
+ $pid2uid{$pid} = int $uid;
diff --git a/debian/patches/x-console.dpatch b/debian/patches/x-console.dpatch
index 677c7e4..baccdd4 100644
--- a/debian/patches/x-console.dpatch
+++ b/debian/patches/x-console.dpatch
@@ -2,7 +2,6 @@
Detect kdm and gdm logins as console users.
In that case jump over the initializeTty routine.
-Using getent to get the uid to be able to work with ldap users.
This is example output from who in this case:
% who
@@ -17,7 +16,7 @@ gdmuser tty7 2008-02-14 20:21 (:0)
--- killer-0.90~/killer 2008-02-26 10:44:58.000000000 +0100
+++ killer-0.90/killer 2008-02-28 13:52:20.000000000 +0100
-@@ -876,10 +876,18 @@
+@@ -876,10 +876,16 @@
while ( <W> ) {
chop;
@parts = split(/[ \t]+/);
@@ -31,9 +30,7 @@ gdmuser tty7 2008-02-14 20:21 (:0)
+ ) {
+ $consoleuser = $parts[0];
+ $tty2idletime{$parts[1]}=0;
-+ my $user = `getent passwd $consoleuser|cut -f3 -d:`;
-+ chomp($user);
-+ push (@{$user2ttys{$user}}, $parts[1]);
++ push (@{$user2ttys{$consoleuser}}, $parts[1]);
+ } else {
+ $self->initializeTty($parts[1], stat("/dev/" . $parts[1]));
+ }
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/killer.git
More information about the debian-edu-commits
mailing list