All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [patch] change user password usable time
@ 2010-09-16  4:51 lina.zhao
  2010-09-16  6:39 ` Garrett Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: lina.zhao @ 2010-09-16  4:51 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

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

[-- Attachment #2: 0001-change-user-password-expiry-time.patch --]
[-- Type: text/x-diff, Size: 3550 bytes --]

From a76578071c5319f47420777fc349c470dcd198aa Mon Sep 17 00:00:00 2001
From: Lina Zhao <lina.zhao@windriver.com>
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 < lina.zhao@windriver.com >
---
 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


[-- Attachment #3: Type: text/plain, Size: 276 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-16  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-16  4:51 [LTP] [patch] change user password usable time lina.zhao
2010-09-16  6:39 ` Garrett Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.