Hi,

Some board do not have a RTC, then when it boot up, the time is 1970.1.1.

if Linux finds 'last password change date' of an account = 1/1/1970 , it forces password change on next login. if the systems' date is like that and you change (as required) the password, each time you login on the same day it will require you to change password.

So in the target whose boot up time is 1/1/1970 and use the 'su' command, there will be 'You are required to change your password immediately (root enforced)' informations and stop the testing.

chage -d 10 userName will let the userName is usable in the next 10 days.

Thanks,

Lina
>From a76578071c5319f47420777fc349c470dcd198aa Mon Sep 17 00:00:00 2001
From: Lina Zhao <[email protected]>
Date: Thu, 16 Sep 2010 11:17:33 +0800
Subject: [PATCH] change user password expiry time

Some board do not have a RTC, then when it boot up, the time is 1970.1.1.
if Linux finds 'last password change date' of an account = 1/1/1970 ,
it forces password change on next login.
So in the target whose boot up time is 1/1/1970 and use the 'su' command,
there will be 'You are required to change your password.
informations and stop the testing.

chage -d 10 userName will let the userName is usable in the next 10 days.

Signed-off-by: Lina Zhao < [email protected] >
---
 testcases/commands/at/at_deny01      |    2 ++
 testcases/commands/cron/cron02       |    1 +
 testcases/commands/cron/cron_allow01 |    2 ++
 testcases/commands/cron/cron_deny01  |    2 ++
 testcases/commands/su/su01           |    2 ++
 5 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/testcases/commands/at/at_deny01 b/testcases/commands/at/at_deny01
index 9f9f433..3a0a711 100755
--- a/testcases/commands/at/at_deny01
+++ b/testcases/commands/at/at_deny01
@@ -64,12 +64,14 @@ do_setup()
 		echo "Could not add test user ${test_user1} to system."
 		exit 1
 	fi
+   chage -d 10 ${test_user1}
 
 	# Create the 2nd user.
 	if ! useradd -g users -d "${test_user2_home}" -m "${test_user2}"; then
 		echo "Could not add test user ${test_user2} to system."
 		exit 1
 	fi
+   chage -d 10 ${test_user2}
 
 	# This is the workaround for a potential bug.
 	# [Bug 468337] At Refuse to Work with Non-login Shell
diff --git a/testcases/commands/cron/cron02 b/testcases/commands/cron/cron02
index 0c05c95..2ca2d88 100755
--- a/testcases/commands/cron/cron02
+++ b/testcases/commands/cron/cron02
@@ -51,6 +51,7 @@ do_setup(){
                 exit 1
         }
         fi
+        chage -d 10 $TEST_USER
 
 	# restart cron daemon
 	# Red Hat uses crond, SuSE/Other uses cron.
diff --git a/testcases/commands/cron/cron_allow01 b/testcases/commands/cron/cron_allow01
index ffecf68..86c5296 100755
--- a/testcases/commands/cron/cron_allow01
+++ b/testcases/commands/cron/cron_allow01
@@ -68,6 +68,7 @@ do_setup() {
         exit 1
     }
     fi
+    chage -d 10 $TEST_USER1
 
 #create 2nd user	
 	useradd -m -g users $TEST_USER2
@@ -77,6 +78,7 @@ do_setup() {
         exit 1
     }
     fi
+    chage -d 10 $TEST_USER2
 }
 
 #-----------------------------------------------------------------------
diff --git a/testcases/commands/cron/cron_deny01 b/testcases/commands/cron/cron_deny01
index 957529b..b1f8263 100755
--- a/testcases/commands/cron/cron_deny01
+++ b/testcases/commands/cron/cron_deny01
@@ -72,6 +72,7 @@ do_setup() {
         exit 1
     }
     fi
+    chage -d 10 $TEST_USER1
 
 #create 2nd user	
 	useradd -m -g users $TEST_USER2
@@ -81,6 +82,7 @@ do_setup() {
         exit 1
     }
     fi
+    chage -d 10 $TEST_USER2
 }
 
 #-----------------------------------------------------------------------
diff --git a/testcases/commands/su/su01 b/testcases/commands/su/su01
index 0a99514..d589365 100755
--- a/testcases/commands/su/su01
+++ b/testcases/commands/su/su01
@@ -115,6 +115,7 @@ rm -f $TEST_ENV_FILE > /dev/null 2>&1
                 exit 1
         }
         fi
+        chage -d 10 $TEST_USER1
 
 #Create 2nd test user
 	#erase user if he may exist , so we can have a clean en
@@ -151,6 +152,7 @@ rm -f $TEST_ENV_FILE > /dev/null 2>&1
                 exit 1
         }
         fi
+        chage -d 10 $TEST_USER2
 }
 
 
-- 
1.6.3.1

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to