Change 32423

russell_jackson (Russell C. Jackson (Rusty))
Russell C. Jackson (Rusty) committed this change into //guest/russell_jackson/sdp/Maintenance
Request Review
Download .zip
Modernize SDP maintenance scripts: security, correctness, and Python 3

- Replace all os.system() and os.popen() calls with subprocess.run() using
  argument lists to eliminate shell injection vulnerabilities
- Fix critical bugs: broken indentation in convert_label_to_autoreload.py,
  malformed print() in p4lock/p4unlock, wrong variable in isitalabel,
  format string typo in maintain_user_from_groups
- Add p4 property alias and shared SKIP_USERS constant to sdputils.py
- Add try/finally with p4.disconnect() to all P4Python scripts
- Replace bare except: with specific exception types throughout
- Update all shebangs to python3, remove unnecessary __future__ imports
- Use context managers for all file handle operations
- Replace from subprocess import * with explicit imports
  • Files 40
  • Comments 0
40 edited 0 added 0 deleted
accessdates.py#9
Loading...
addusertogroup.py#4
Loading...
checkusers.py#4
Loading...
checkusers_not_in_group.py#4
Loading...
clean_protect.py#4
Loading...
convert_label_to_autoreload.py#4
Loading...
countrevs.py#4
Loading...
creategroups.py#4
Loading...
createusers.py#4
Loading...
del_shelve.py#7
Loading...
delete_unload_clients.py#9
Loading...
delusers.py#4
Loading...
email.sh#5
Loading...
email_pending_client_deletes.py#10
Loading...
email_pending_user_deletes.py#6
Loading...
group_audit.py#4
Loading...
isitalabel.py#4
Loading...
lowercp.py#4
Loading...
lowertree.py#4
Loading...
maintain_user_from_groups.py#5
Loading...
mirroraccess.py#4
Loading...
p4deleteuser.py#11
Loading...
p4lock.py#4
Loading...
p4unlock.py#4
Loading...
protect_groups.py#4
Loading...
proxysearch.py#4
Loading...
pymail.py#4
Loading...
remove_empty_pending_changes.py#9
Loading...
remove_jobs.py#4
Loading...
removeuserfromgroups.py#4
Loading...
removeuserfromgroups_file.py#3
Loading...
removeusersfromgroup.py#4
Loading...
sdputils.py#8
Loading...
setpass.py#4
Loading...
totalusers.py#9
Loading...
unload_clients.py#9
Loading...
unload_clients_with_delete.py#9
Loading...
unload_labels.py#5
Loading...
unloadaccessdates.py#4
Loading...
update-changes.py#4
Loading...
Tip: Use n and p to cycle through the changes.