There was an error while loading. Please reload this page.
1 parent 3959cc4 commit a360b70Copy full SHA for a360b70
1 file changed
irods/test/pam.bats/funcs
@@ -117,3 +117,14 @@ finalize_pam_login_for_alice() {
117
test_specific_cleanup() {
118
eval "$CLEANUP"
119
}
120
+
121
+# PostgreSQL only
122
+age_out_pam_password() {
123
+ local id=$(iquest %s "select USER_ID where USER_NAME = '$1'")
124
+ local offset=$(sudo su - postgres -c "psql -t ICAT -c 'select pass_expiry_ts from r_user_password where user_id = $id'")
125
+ local mtime=$(sudo su - postgres -c "psql -t ICAT -c 'select modify_ts from r_user_password where user_id = $id'")
126
+ mtime=$(sed 's/^\s*0//' <<<"$mtime")
127
+ ((offset+=1))
128
+ local new_time=$((mtime - offset))
129
+ sudo su - postgres -c "psql ICAT -c 'update r_user_password set create_ts=$new_time, modify_ts=$new_time where user_id=$id'"
130
+}
0 commit comments