Pages

Showing posts with label Perforce. Show all posts
Showing posts with label Perforce. Show all posts

Monday, August 17, 2015

Set Perforce Security Level

There is Security level on Perforce

The Perforce server security levels and their effects on the behavior of Perforce applications are defined below.
Security level
Server behavior
0 (or unset)
Legacy support: passwords are not required. If passwords are used, password strength is not enforced.
Users with passwords can use either their P4PASSWD setting or the p4 login command for ticket-based authentication.
Users of old Perforce applications are unaffected.
1
Legacy support: Strong passwords are required for users of post-2003.2 Perforce applications, but existing passwords are not reset.
Pre-2003.2 Perforce applications can set passwords with p4 passwd or in the p4 user form, but password strength is not enforced.
Users with passwords can use either their P4PASSWD setting or the p4 login command for ticket-based authentication.
The dm.password.minlength configurable can be set to enforce a minimum password length.
2
Legacy support: All unverified strength passwords must be changed.
Users of pre-2003.2 Perforce applications cannot set passwords. Users at release 2003.2 or higher must usep4 passwd and enter their passwords at the prompt. Setting passwords with the p4 user form or thep4 passwd -O oldpass -P newpass command is prohibited.
On Windows, passwords are no longer stored in (or read from) the registry. (Storing P4PASSWD as an environment variable is supported, but passwords set with p4 set P4PASSWD are ignored.)
Users who have set strong passwords with a 2003.2 or higher Perforce application can use either their P4PASSWDsetting for password-based authentication, or the p4 login command for ticket-based authentication.
The dm.password.minlength configurable can be set to enforce a minimum password length.
3
All password-based authentication is rejected.
Users must use ticket-based authentication (p4 login).
If you have scripts that rely on passwords, use p4 login to create a ticket valid for the user running the script, or use p4 login -p to display the value of a ticket that can be passed to Perforce commands as though it were a password (that is, either from the command line, or by setting P4PASSWD to the value of the valid ticket).
The dm.password.minlength configurable can be set to enforce a minimum password length.
4
Authenticated service users must be used for all replica server and remote depot connections to this server.

if you run the command p4 configure show, it'll show the current configuration.
Problem:
 p4 configure set security=3

Resolution:
We ran p4 -ztag info, gives us the ServerID as "servername"

To reset the security level
we found the Perforce Root,
[/var/libp4d] p4d -r /var/lib/p4d -J /var/lib/p4d/journal/journal.jnl "-cset p4server4#security=1"


Monday, January 20, 2014

Perforce label command line

Label a depot in perforce with specific Changelist.

To list the label description
p4 label -o riat-1.0-SP3-maven1-stable

It labels all the latest revision files in the below mentioned depots with label name riat-1.0-SP3-maven1-stable
p4 tag -l riat-1.0-SP3-maven1-stable //library/apache-maven/1.1/... //library/apache-log4cxx/0.10.0/... //user_information/RIAT/...

It labels all the latest revision of all the branch and specified revision on release depots with label name riat-1.0-SP3-maven1-stable
p4 tag -l riat-1.0-SP3-maven1-stable //library/apache-maven/1.1/... //library/apache-log4cxx/0.10.0/... //user_information/RIAT/... //release/riat-1.0/@1370707


It just list the file with revision on the label, we can compare this revision with the latest one.
p4 files @riat-1.0-SP3-maven1-stable |grep "project.properties"

Tuesday, July 31, 2012

Perforce commands FAQ


1) How to delete a Perforce client?
p4 client -d 

2) How to copy named template's view to current client?
p4 client -t 

3) What is the use of P4CONFIG environment variable?
You can define Perforce environment variables in this configuration file. Place this file in your client root or even top-level directory. Perforce will fetch values from this configuration file.
For Ex: setenv P4CONFIG .p4config
cd $P4ROOT
vi .p4config
P4PORT=localhost:1666
P4CLIENT=client1

4) How to retrieve a file revision from Perforce depot?
p4 print -q //depot/source/proj1/test.c#5 > test.c

5) How to add the entire directory to Perforce?
find . -type f|p4 -x- add
find . -type l|p4 -x- add -t symlink

6) How to check who all working(opened) on a given file?
p4 opened -a 
7) How to list opened files that are different than the revision in the depot or missing?
p4 diff -sa

8) Listing unopened files that are missing on the client
p4 diff -sd

9) Listing unopened files that are different from the revision in the depot
p4 diff -se

10) Listing opened files that are same as the revision in the depot
p4 diff -sr

11) How to revert all files opened for edit but have unchanged content?
p4 revert -a

12) Locking an opened file against submission
p4 lock file-name
To unlock
p4 unlock file-name

13) How to list the differences between the 2 branches?
p4 diff -q //depot/main/jam/... //depot/rel1/jam/...

14) Deleting and re-adding files
% p4 delete file.txt
//depot/src/file.txt#33 - opened for delete
% p4 submit
Delete //depot/src/file.txt#34
Change 145 submitted
% p4 sync file.txt#33
% p4 add file.txt
%p4 submit
Add //depot/src/file.txt#35
Change 146 submitted