Perforce Public Knowledge Base - Authenticate with the review daemon script if an auth trigger is used.
Perforce Software logo
Reset Search
 

 

Article

Authenticate with the review daemon script if an auth trigger is used.

« Go Back

Information

 
Problem

The Perforce Review Daemon is written in Python and obtains the needed Perforce variables from the Review Daemon's environment.  However, when a Perforce auth trigger is used to provide external authentication to the Perforce server, the Perforce server security level is set to 3 by default. The result is the "P4PASSWD" variable as set in the environment is ignored.

Solution

Prior to implementing an auth trigger, the p4review.py script might have used the following example code to log in as a Perforce user:

os.environ['P4PORT'] = 'server:1666'
os.environ['P4USER'] = 'p4_user_name_here'
os.environ['P4PASSWD'] = 'p4_passwd_here'

After the auth trigger is set, the script needs to be changed to authenticate as a Perforce user using "p4 login". Change (or comment out) the P4PASSWD line and add:

os.system('echo the_password | p4 login')

Replacing "the_password" with the password for the user running the Review Daemon. The resulting code now looks similar to:

os.environ['P4PORT'] = 'server:1666'
os.environ['P4USER'] = 'p4_user_name_here'
os.system('echo the_password | p4 login')

Note: This is a potential security risk as it exposes the review user's password as plain text. If security is a concern, consider using a long login timeout ticket instead.

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255