set_password_for_bruno.sh #2

  • //
  • p4-sdp/
  • dev_c2s/
  • test/
  • bsw/
  • set_password_for_bruno.sh
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/bin/bash
set -u

# Make it so user has a password.
# Start state: Bruno may or may not already have a password set.
# Just attempt to set it and ignore errors if already set.

#==============================================================================
# Declarations and Environment

# Version ID Block. Relies on +k filetype modifier.
#------------------------------------------------------------------------------
# shellcheck disable=SC2016
declare VersionID='$Id: //p4-sdp/dev_c2s/Server/Unix/p4/common/bin/mkrep.sh#3 $ $Change: 31580 $'
declare VersionStream=${VersionID#*//}; VersionStream=${VersionStream#*/}; VersionStream=${VersionStream%%/*};
declare VersionCL=${VersionID##*: }; VersionCL=${VersionCL%% *}
declare Version=${VersionStream}.${VersionCL}
[[ "$VersionStream" == r* ]] || Version="${Version^^}"

declare SDPInstance=${1:-${SDP_INSTANCE:-1}}

# shellcheck disable=SC1091
source /p4/common/bin/p4_vars "$SDPInstance"

echo "As user $P4USER, setting password for user bruno."
yes "$(cat "$SDP_ADMIN_PASSWORD_FILE")" | p4 -s passwd bruno

echo "Logging in bruno after password change."
p4 login bruno
# Change User Description Committed
#2 31747 C. Thomas Tyler Added VersionID block to more scripts.
#1 31580 C. Thomas Tyler Merge dev->dev_c2s.
Several interactive merges were required, mostly due
to the change to version strings.
//p4-sdp/dev/test/bsw/set_password_for_bruno.sh
#1 31574 C. Thomas Tyler Merged SDP 2024.2 Patch 4 from Classic to Streams.
p4 merge -b SDP_Classic_to_Streams
//guest/perforce_software/sdp/dev/test/bsw/set_password_for_bruno.sh
#2 31547 C. Thomas Tyler SDP BSW regression test suite refinements.
#1 31521 C. Thomas Tyler Refined tests for ccheck.sh with -sec.
Added more tests for -fix/-FIX.

Refined scan for unreported test errors to ignore known harmless
warnings.

Added utility script to set password and login bruno, as needed when
messing with security configurations.