All of lore.kernel.org
 help / color / mirror / Atom feed
From: "lina.zhao" <lina.zhao@windriver.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [patch] change user password usable time
Date: Thu, 16 Sep 2010 12:51:10 +0800	[thread overview]
Message-ID: <4C91A23E.6080506@windriver.com> (raw)

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

             reply	other threads:[~2010-09-16  4:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16  4:51 lina.zhao [this message]
2010-09-16  6:39 ` [LTP] [patch] change user password usable time Garrett Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C91A23E.6080506@windriver.com \
    --to=lina.zhao@windriver.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.