Hexid M1n1 5h3ll MobiLe
HOME
+FILE
+DIR
Server Info
Mass Tools
Auto Unzip File
UpLite
Upload
Upmod
lib64
/
python2.7
/
Demo
/
pdist
/
_
[
Not.Writable
]
File Upload :
Gaszz
File://lib64/python2.7/Demo/pdist/cvslock.pyo
� ��^c�����������@���s����d��Z��d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�Z�d�Z�d�Z�d�Z�d�Z �d�d�d �������YZ �d �e �f�d�������YZ�d�d�d �������YZ�d����Z �d�e�f�d�������YZ�d�e�f�d�������YZ�e�d���Z�d����Z�e�d�k�r��e����n��d�S(���s���CVS locking algorithm. CVS locking strategy ==================== As reverse engineered from the CVS 1.3 sources (file lock.c): - Locking is done on a per repository basis (but a process can hold write locks for multiple directories); all lock files are placed in the repository and have names beginning with "#cvs.". - Before even attempting to lock, a file "#cvs.tfl.<pid>" is created (and removed again), to test that we can write the repository. [The algorithm can still be fooled (1) if the repository's mode is changed while attempting to lock; (2) if this file exists and is writable but the directory is not.] - While creating the actual read/write lock files (which may exist for a long time), a "meta-lock" is held. The meta-lock is a directory named "#cvs.lock" in the repository. The meta-lock is also held while a write lock is held. - To set a read lock: - acquire the meta-lock - create the file "#cvs.rfl.<pid>" - release the meta-lock - To set a write lock: - acquire the meta-lock - check that there are no files called "#cvs.rfl.*" - if there are, release the meta-lock, sleep, try again - create the file "#cvs.wfl.<pid>" - To release a write lock: - remove the file "#cvs.wfl.<pid>" - rmdir the meta-lock - To release a read lock: - remove the file "#cvs.rfl.<pid>" Additional notes ---------------- - A process should read-lock at most one repository at a time. - A process may write-lock as many repositories as it wishes (to avoid deadlocks, I presume it should always lock them top-down in the directory hierarchy). - A process should make sure it removes all its lock files and directories when it crashes. - Limitation: one user id should not be committing files into the same repository at the same time. Turn this into Python code -------------------------- rl = ReadLock(repository, waittime) wl = WriteLock(repository, waittime) list = MultipleWriteLock([repository1, repository2, ...], waittime) i����Ni ���i���s���#cvs.lcks ���#cvs.rfl.s ���#cvs.wfl.t���Errorc�����������B���s#���e��Z�d�����Z�d����Z�d����Z�RS(���c���������C���s ���|�|��_��d��S(���N(���t���msg(���t���selfR���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyt���__init__`���s����c���������C���s ���t��|��j���S(���N(���t���reprR���(���R���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyt���__repr__c���s����c���������C���s ���t��|��j���S(���N(���t���strR���(���R���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyt���__str__f���s����(���t���__name__t ���__module__R���R���R���(����(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR����^���s��� t���Lockedc�����������B���s���e��Z�RS(����(���R���R ���(����(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR ���j���s���t���Lockc�����������B���sV���e��Z�d��e�d���Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z �d����Z �RS( ���t���.c���������C���sx���|�|��_��|�|��_�d��|��_�d��|��_�t�t�j������}�|��j�t ���|��_ �|��j�t�|���|��_�|��j�t �|���|��_�d��S(���N(���t ���repositoryt���delayt���Nonet���lockdirt���lockfileR���t���ost���getpidt���joint���CVSLCKt���cvslckt���CVSRFLt���cvsrflt���CVSWFLt���cvswfl(���R���R ���R���t���pid(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR���p���s���� c���������C���s���d�GH|��j�����d��S(���Nt���__del__(���t���unlock(���R���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR���z���s����c���������C���s����x��y'�|��j��|��_�t�j�|��j��d���d��SWq�t�j�k �r��}�d��|��_�|�d�t�k�r��y�t�j�|��j����}�Wn�t�j�k �r��q�n�X|��j�|���q�n��t �d�|��j �|�f�����q�Xq�Wd��S(���Ni���i����s���failed to lock %s: %s(���R���R���R���t���mkdirt���errorR���t���EEXISTt���statt���sleepR����R ���(���R���R���t���st(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyt ���setlockdir~���s ���� c���������C���s���|��j�����|��j����d��S(���N(���t ���unlockfilet ���unlockdir(���R���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR�������s���� c���������C���sP���|��j��rL�d�G|��j��GHy�t�j�|��j����Wn�t�j�k �r?�n�Xd��|��_��n��d��S(���Nt���unlink(���R���R���R'���R���R���(���R���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR%�������s���� c���������C���sP���|��j��rL�d�G|��j��GHy�t�j�|��j����Wn�t�j�k �r?�n�Xd��|��_��n��d��S(���Nt���rmdir(���R���R���R(���R���R���(���R���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR&�������s���� c���������C���s���t��|�|��j�|��j���d��S(���N(���R"���R ���R���(���R���R#���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR"�������s����c���������C���s���t��j�j�|��j�|���S(���N(���R���t���pathR���R ���(���R���t���name(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR�������s����(���R���R ���t���DELAYR���R���R$���R���R%���R&���R"���R���(����(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR���n���s��� c���������C���s����|�d�k�r�t��|������n��|��t�j�}�y�t�j�|���}�|�d�}�Wn�t�k �rb�d�|�}�n�Xd�t�j�t�j������d�d�!Gd�|�G|�GHt�j�|���d��S(���Ni����s���uid %ds���[%s]i���i���s���Waiting for %s's lock in( ���R ���R!���t���ST_UIDt���pwdt���getpwuidt���KeyErrort���timet���ctimeR"���(���R#���R ���R���t���uidt���pwentt���user(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR"�������s���� t���ReadLockc�����������B���s���e��Z�e�d����Z�RS(���c���������C���sz���t��j�|��|�|���d�}�z<�|��j����|��j�|��_�t�|��j�d���}�|�j����d�}�Wd��|�sk�|��j����n��|��j����Xd��S(���Ni����t���wi���( ���R���R���R$���R���R���t���opent���closeR%���R&���(���R���R ���R���t���okt���fp(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR�������s���� (���R���R ���R+���R���(����(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR5�������s���t ���WriteLockc�����������B���s���e��Z�e�d����Z�d����Z�RS(���c���������C���s}���t��j�|��|�|���|��j����x1�|��j����}�|�s6�Pn��|��j����|��j�|���q �W|��j�|��_�t�|��j�d���}�|�j ����d��S(���NR6���( ���R���R���R$���t ���readers_existR&���R"���R���R���R7���R8���(���R���R ���R���R2���R:���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR�������s���� c���������C���sw���t��t���}�xd�t�j�|��j���D]P�}�|�|� t�k�r�y�t�j�|��j�|�����}�Wn�t�j�k �rj�q�n�X|�Sq�Wd��S(���N( ���t���lenR���R���t���listdirR ���R!���R���R���R���(���R���t���nR*���R#���(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR<�������s����(���R���R ���R+���R���R<���(����(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyR;�������s��� c���������C���sj���xc�g��}�xC�|��D]:�}�y�|�j��t�|�d�����Wq�t�k �rI�}�~�Pq�Xq�WPt�|�j�|�|���q�Wt�S(���Ni����(���t���appendR;���R ���R"���R���t���list(���t���repositoriesR���t���lockst���rt���instance(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyt���MultipleWriteLock����s���� c����������C���s����d�d��l��}��|��j�d�r)�|��j�d�}�n�d�}�d��}�d��}�zD�d�GHt�|���}�d�GH|�j����d�GHt�|���}�d�GH|�j����Wd��d�g�GHd��|��_�d�g�GH|�r��|�j����n��d�g�GH|�r��|�j����n��d �g�GHd��}�d �g�GHd��}�d�g�GHXd��S(���Ni����i���R���s���attempting write lock ...s���got it.s���attempting read lock ...i���i���i���i���i���(���t���syst���argvR���R;���R���R5���t ���exc_traceback(���RG���R ���t���rlt���wl(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyt���test����s8���� t���__main__(����(����(���t���__doc__R���R0���R!���R-���R+���R ���R���R���R���R����R ���R���R"���R5���R;���RF���RL���R���(����(����(����s*���/usr/lib64/python2.7/Demo/pdist/cvslock.pyt���<module>G���s&���? !
Copyright © 2025 -
Tex7ure
|
Hillusion Exploit ID
Your Access Expired
Date. in :
14-03-2025
Regist :
09-12-2024
Expired :
01-12-2027