#!/usr/bin/env python #============================================================================== # Copyright and license info is available in the LICENSE file included with # the Server Deployment Package (SDP), and also available online: # https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/main/LICENSE #------------------------------------------------------------------------------ # # This is command trigger to allow you to block commands from all but listed users. # # Trigger table entry examples: # command-block command pre-user-obliterate "/p4/common/bin/triggers/command_block.py %user%" # command-block command pre-user-(obliterate|protect$) "/p4/common/bin/triggers/command_block.py %user%" import sys passusers = [ 'perforce' ] user=sys.argv[1] if user in passusers: sys.exit(0) else: print("You are not allowed to run this command.") sys.exit(1)
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 23960 | noe_gonzalez | "Forking branch Dev of perforce-software-sdp to noe_gonzalez-sdp." | ||
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin/triggers/command_block.py | |||||
#4 | 22318 | Russell C. Jackson (Rusty) | Corrected comments for trigger file name. | ||
#3 | 16373 | C. Thomas Tyler |
Routine Merge Down to dev from main using: p4 merge -b perforce_software-sdp-dev |
||
#2 | 16029 | C. Thomas Tyler |
Routine merge to dev from main using: p4 merge -b perforce_software-sdp-dev |
||
#1 | 12107 | C. Thomas Tyler |
Routine merge down from 'main' to 'dev', resolved with 'p4 resolve -as'. |
||
//guest/perforce_software/sdp/main/Server/Unix/p4/common/bin/triggers/command_block.py | |||||
#2 | 12104 | Russell C. Jackson (Rusty) | Updated date to 2015 | ||
#1 | 12067 | Russell C. Jackson (Rusty) |
Changed mkdirs.sh to default to 1666 and added comment to replace the broker with command triggers. Added simple command trigger to block commands in the server. |