Crontab command fail if user is not present in cron.allow file.
This moves away cron.allow and restores it afterward.

Signed-off-by: Gilles Carry <[email protected]>
---
 testcases/commands/cron/cron_deny01 |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/testcases/commands/cron/cron_deny01 
b/testcases/commands/cron/cron_deny01
index 95bb93d..0cd75fd 100755
--- a/testcases/commands/cron/cron_deny01
+++ b/testcases/commands/cron/cron_deny01
@@ -32,8 +32,10 @@ tvar=${tvar#*-}
 if [ $tvar = "redhat" -o $tvar = "redhat-linux" ] 
 then
 CRON_DENY="/etc/cron.deny"
+CRON_ALLOW="/etc/cron.allow"
 else
 CRON_DENY="/var/spool/cron/deny"
+CRON_ALLOW="/var/spool/cron/allow"
 fi
 
 TEST_USER1="cd_user1"
@@ -51,6 +53,7 @@ do_setup() {
         rm /tmp/cron_deny_test1 &> /dev/null
        
        mv $CRON_DENY $CRON_DENY.old &> /dev/null
+       mv $CRON_ALLOW $CRON_ALLOW.old &> /dev/null
 
        #remove users for clean enviroment
         rm -rf /home/$TEST_USER1
@@ -88,6 +91,7 @@ do_cleanup(){
        userdel $TEST_USER2
        rm $CRON_DENY
        mv $CRON_DENY.old $CRON_DENY &> /dev/null
+       mv $CRON_ALLOW.old $CRON_ALLOW &> /dev/null
        rm /tmp/cron_allow_test &>/dev/null
 }
 
-- 
1.5.5.GIT


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to