backend/satellite_tools/accounts/satpasswd | 14 +++++---------
backend/satellite_tools/accounts/satwho | 21 ++++-----------------
2 files changed, 9 insertions(+), 26 deletions(-)
New commits:
commit 3b803b2a03011b66309b2c1745089506340c25f8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 11 11:58:32 2011 +0100
Use the base web_contact table to make it consistent with what we had to do in satpasswd for PostgreSQL.
diff --git a/backend/satellite_tools/accounts/satwho b/backend/satellite_tools/accounts/satwho
index bf5aada..babd69b 100755
--- a/backend/satellite_tools/accounts/satwho
+++ b/backend/satellite_tools/accounts/satwho
@@ -6,7 +6,7 @@
# date: 2006-01-31, 2011-01-11
BLOCK=0
-echo "select login from rhnuser;"| spacewalk-sql --select-mode - | grep -v "^$" |\
+echo "select login from web_contact;"| spacewalk-sql --select-mode - | grep -v "^$" |\
while read line
do
if [ $BLOCK -eq 0 ]
commit 99c2756641f83fb8eb99b366e8bf71033865e823
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 11 11:57:54 2011 +0100
Use spacewalk-sql in satpasswd, thus making it work on PostgreSQL.
diff --git a/backend/satellite_tools/accounts/satpasswd b/backend/satellite_tools/accounts/satpasswd
index ed13ad5..7fbdbe4 100755
--- a/backend/satellite_tools/accounts/satpasswd
+++ b/backend/satellite_tools/accounts/satpasswd
@@ -2,17 +2,12 @@
# name: satpasswd
# description: Change the password of a satellite user
# author: G.R.Keech <rkeech(a)redhat.com>
-# date: 2006-01-31
-#
-# NOTICE: The use of this code/script is only for the use with RHN
-# Satellite and an external database. It is not permitted to use this
-# script within RHN Satellite and an embedded database.
+# Jan Pazdziora
+# date: 2006-01-31, 2011-01-11
-SQLPLUS=/usr/bin/sqlplus
SATWHO=/usr/bin/satwho
MD5=/usr/bin/openssl
MD5ARGS="passwd -1 -stdin"
-CREDENTIALS=$(spacewalk-cfg-get default_db)
PROG=satpasswd
myuser=""
@@ -26,7 +21,7 @@ EOF
}
#==================================================================
-for P in $SQLPLUS $SATWHO $MD5
+for P in $SATWHO $MD5
do
if [ ! -x "$P" ]
then
@@ -136,4 +131,5 @@ md5password="$( echo "$password" | $MD5 $MD5ARGS )"
# the password for the user.
-echo "update rhnuser set password = '"$md5password"' where login = '"$myuser"';"| $SQLPLUS -S $CREDENTIALS &> /dev/null
+echo "update web_contact set password = '"$md5password"' where login = '"$myuser"';"| spacewalk-sql -
+exit $?
commit f68352789821e1fb5436d08de6a615c695c711d5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 11 11:40:26 2011 +0100
Use spacewalk-sql in satwho, thus making it work on PostgreSQL.
diff --git a/backend/satellite_tools/accounts/satwho b/backend/satellite_tools/accounts/satwho
index 9beb039..bf5aada 100755
--- a/backend/satellite_tools/accounts/satwho
+++ b/backend/satellite_tools/accounts/satwho
@@ -2,24 +2,11 @@
# name: satwho
# description: Print a list of the satellite users.
# author: G.R.Keech <rkeech(a)redhat.com>
-# date: 2006-01-31
-#
-# NOTICE: The use of this code/script is only for the use with RHN
-# Satellite and an external database. It is not permitted to use this
-# script within RHN Satellite and an embedded database.
-
-SQLPLUS=/usr/bin/sqlplus
-CREDENTIALS=$(spacewalk-cfg-get default_db)
-
-if [ ! -x $SQLPLUS ]
-then
- echo Sorry, I cannot find \"$SQLPLUS\" to execute
- exit 1
-fi
-
+# Jan Pazdziora
+# date: 2006-01-31, 2011-01-11
BLOCK=0
-echo "select login from rhnuser;"| $SQLPLUS -S $CREDENTIALS| grep -v "^$" |\
+echo "select login from rhnuser;"| spacewalk-sql --select-mode - | grep -v "^$" |\
while read line
do
if [ $BLOCK -eq 0 ]
@@ -30,7 +17,7 @@ do
echo "$line" | grep "^-*$" &>/dev/null && BLOCK=1
else
# We are in the block, so print the line, so long as it is not the line with "rows selected"
- echo "$line" | grep "rows selected.$" &>/dev/null || echo $line
+ echo "$line" | egrep "rows?\)$|rows selected.$" &>/dev/null || echo $line
fi
done