UNDERCODE COMMUNITY
2.67K subscribers
1.23K photos
31 videos
2.65K files
79.9K links
πŸ¦‘ Undercode Cyber World!
@UndercodeCommunity


1️⃣ World first platform which Collect & Analyzes every New hacking method.
+ AI Pratice
@Undercode_Testing

2️⃣ Cyber & Tech NEWS:
@Undercode_News

3️⃣ CVE @Daily_CVE

✨ Web & Services:
β†’ Undercode.help
Download Telegram
πŸ¦‘ PAID HACKING PDFs
This media is not supported in your browser
VIEW IN TELEGRAM
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘Why is ODBC not a standard feature of Linux?
T.me/UndercodeTesting

1) Years ago, Microsoft announced a technology strategy called Windows Open Services Architecture (WOSA). The essence of WOSA is Open Database Connectivity (ODBC), which is a model of a universal database access service provided by the Windows platform, and database vendors provide adapters for their products.

2) Therefore, Windows applications can avoid the work of adapters written for data sources, and instead use the standardized ODBC framework to access data and concentrate on doing useful things.

3) The same idea is working elsewhere in Windows. For example, unified printer and modem access. And Microsoft did an excellent job to offset the differences between various networks. Windows network services can be run in the same way on TCP / IP, IPX / SPX and NetBEUI, because the platform abstracts the differences between these protocols on a middle layer.

4) "Microsoft is just a commercial company," the Linux community likes to think so. This statement has a lot of truth, but the true story is much more complicated. When Microsoft introduced WOSA-style abstractions into core services, it appeared as a reformer, and Unix / Linux was more like a hobble primitive.

written by undercode
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ¦‘ EXPERT HACKING TIPS BY UNDERCODE
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁


πŸ¦‘ Using Linux as the CVS server1 version control concepts and the introduction of several version control tools
fb.com/UndercodeTesting

marked with version 1.1 of the concept of source files

πŸ¦‘source files is the most important a component of a software unit, the management of the source file is composed of the entire software management is the most important part Is the key to efficient software development. To manage source files, you must mark the source files. It is generally considered that only the file name is needed. In fact, the labeling of source files under a version maintenance tool includes two parts: File name and version. That is: the source file can be represented by the following binary tuple {filename, version}; the

1) > so-called version, the general software developers have an intuitive understanding, but it is difficult to make an accurate definition. Version, Refers to the potential existence of a specific instance of a specific object. A specific object here refers to a software component managed by a version maintenance tool, generally refers to a source file. A specific instance refers to a software developer from the software storage room A real copy of the restored software constituent unit with certain contents and attributes.

2) The definition of the version as a potential existence is based on the following Consider: The version is used as a representation part of the source file, and the software personnel's reference to it actually wants different source files corresponding to different versions, so the version is an abstraction. It is used to define the content and attributes that a specific instance should have. That is to say, the version is a potential existence of a specific instance, an abstraction of different incarnations of the source file.

3) With the above understanding of the concept of version. Everyone has a certain understanding of the version maintenance tool: the version maintenance tool should be for developers The storage method of shielded source files is transparent to developers. Developers do not need to understand what source files are in the software repository, but only need to explain what source files are needed and what source files are to be stored.The version maintenance tool is automatically completed. All this works. The theory about version maintenance also includes: version space, dimension, version representation, storage, merge and other theories, because we mainly explain the cvs linux server here, so everything is simple, friends who are interested in this aspect can read books

5) this tut talking about cvs is such a powerful tool. we first before telling cvs Introduce several other version maintenance tools.

πŸ¦‘ 1.2 Introduction to maintenance tools for several versions

1.2..1 SCCS

The full name of SCCS is Source Code Control System. Before the introduction, the concept of working file is defined. The so-called working file refers to the β€œwrite” permission obtained from the software storage room. Source files.

SCCS is a basic source file version control tool, which is suitable for the version maintenance of any text file. It is based on the version control of a single file. Generally, its software storage room and the file to be maintained are in the same directory.

When SCCS works, there is a special SCCS format file that retains the encoded version of its source file, which records enough information to generate a new version, and records who has the right to modify the file and has a "lock" for that version.


The version of SCCS is a good four-tuple, namely: release number, level number, branch number, sequence number (release, level, banch, sequence)


1.2.2 RCS

πŸ¦‘ WHAT IS RCS
1) > is another basic source code management tool, which is WALTER.f .Tichy was developed at Purdue University in Indina in 1980. RCS is similar to SCCS and is also a version maintenance system based on a single file. RSC manages files through RSC files; the maintenance process using RCS is similar to SCCS. It is also carried out according to the recovery submission

2) mode.It is not a detailed description of the RCS file. It is a storage room for source files in the RCS system. It is a special encoding file that contains sufficient information for developers to restore the old version of the source file for development. it usually .V suffix

3) as its structure:

? RCS head, the portion of the recording head corresponding to the version number of the file tree,

the version? description: this section describes the nature of the attribute of each node of the tree RCS

? initial Information: One part is what was expressed when creating the first RCS version

? File content

RCS is similar to SCCS. RCS organizes the maintained versions into a tree structure. However, RCS allows multiple branches, that is, the version number of RCS is not a quadruple like SCCS. The form is: issue number, level number, ( Branch number, serial number].


written by undercode
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

The two versions of maintenance tools have in common: the "lock" method is adopted, and users who insist on having a "lock" to the current question have the right to modify the file. . mechanisms they used the so-called "lock-modify-unlock". With this well-known that only a weakness, that is not so far a multi-user concurrent use.

2 build cvs server under Linux

2.1 Introduction and rationale CVS

CVS The full name is Current Version Control. CVS is a GNU software package. Developed by Intersolv, the latest version is 1.10.8. It is a maintenance tool based on the RCS system. It explicitly stores the source files and the user ’s The working space is independent, and it has expanded the recovery submission function of RCS in a certain mode. It makes it advantageous and parallel development.

CVS concentrates the RCS files of source files under a directory according to the hierarchy of its source tree. Absolute path by environment CVSROOT defined amount of
γ€€

visible The directory can be divided into two parts: part of the $ {CVSROOT} / CVSROOT, which contains some of the desired CVS RCS file management file as another part formed a source file, software development in accordance source tree structure . constitutedγ€€

on files in the CVSROOT, in later sections, to explain in detail the structure ,, and the workspace in the source code directoryγ€€

CVS source control is performed has the following characteristics:

1, the source separation space and user space.

The CVS system places the source code files under the repository.Users must modify the files to make a copy of the files under the repository before they can modify it.2

. Concurrent access to the

CVS system allows multiple developers to obtain the same version of the source file of the same file at the same time. Of course, this is also the main reason why CVS is widely used. When a developer extracts a file, he will create a copy in his workspace that is independent of other developers. The version number of this file is the same as the "header" version of the file, unless he uses the commit command to complete the permanent upgrade of the version. At this time, other users can use the undate command to match their version number with the "latest header version number.": If the user finds that the header version has changed after checkout, a new file can be formed using the rcsmerge command of the RCS system. This new file and including the original content, but also includes content modified by the user. this weakness and other conflicts occur simultaneously on the same file modification developers, can notify them manually modify
Therefore, CVS system is a Copy-modify-Merge algorithm and The advantage of this algorithm that is not the lock-modify-unlockj mechanism used by the two systems mentioned above is that software developers can get a copy of the source file (Copy) and will not lock the file. ", Thus providing the possibility for parallel development. After getting the copy, developers can modify it in their own development environment (Modify ), Then submit your modified file and merge it with the source file to form a new version.

3. The source file sharing

CVS uses $ {CVSROOT} for different users. Users can copy different templates according to their needs. after modifying the carrier to $ {CVSROOT}. in this way users can share source files. this is of course we have established the necessary CVS server

4, independent work environment

users make changes to develop in their own work environment, it is natural to work independently The environment is worth saying. CVS also supports a "lock" mechanism. Allows users to lock the template copy they have obtained

5, numerals

CVS To facilitate the introduction of a tag file located in the working directory of the user, and the CVS directory is a file operation he labeled specific tag file, i.e., the operation of the respective version, even if the The version has been modified.

2.2. Obtaining and installing

CVS CVS has a default installation in general Linux distributions. If your system is not installed, it does not matter, CVS can be easily obtained on the Internet. Its source code is in ftp : //202.113.29.4/pub1/unix/cvs It's documentation is at ftp://202.113.29.4/doc/cvs. Anyone can download it easily. At present his latest version is 2.10.8.

Installation The process is roughly as follows:

1. Unzip the downloaded compressed file in any directory.

2 Use the installation tool in the file package to complete the installation (with instructions). Usually it is:

make config

make install

(unavailable version, installation method may be different, specific see, it brought their own installation documentation)

γ€€

installation 2.3 server to use

after installing the CVS system we can start to install CVS repository. in the linux environment, CVS is generally based on the use of the command line And there is also GUI front-end tools, such as TKCVS etc. Here we will apply the general CVS command that is cvs [cvs options] cvs-command [command options] way to complete the configuration server.

2.3.1 software repository (repository) management

1 Create CVSROOT root directory

first edit the relevant environmental variables (CVS a few important environment variables are as follows:

CVSROOT warehouse full pathname of the root directory of

CVSREAD If set, indicates that the operation at the time of checkout all files are set to read-only

CVSBIN CVS use a lot of orders RCS, RCS tool path specified music

CVSEDITOR specify the user to write the log information used to edit When the

CVS_RSH server starts a remote CVS server, the name of the shell used

CVS_SERVER determines the name of "" cvs server "", the default is the CVS

CVSWRAPPERS cvswrapper script, which is used to specify the package file name.)

The important one is CVSROOT, It indicates the location of the warehouse is located, in the creation of a new warehouse, it is essential therefore generally necessary to add the definition of the environment variable CVSROOT as add the following two lines in the / etc / bashrc file

CVSROOT = / cvsroot

Export CVSROOT

or Directly execute

$ export CVSROOT = / cvsroot on the command line

and start creating CVSROOT at the corresponding location

$ mkdir cvsroot

$ cvs init

If there is no variable CVSROOT defined, this prompt will appear:

cvs init: No CVSROOT specified! Please use the '-d' option

cvs [initn aborted]: or set the CVSROOT environemnt variable

If you do not want to define environment variables, you can use this command:
cvs --d / cvroot init But even if you define CVSROOT, the content after the parameter --d will override it. If there is no error prompt, congratulations, your The CVS software library has been established. The

remaining question is how to use this repository for parallel software development and version control. And as a CVS administrator, you should set your user permissions. At this time, you There is a CVSROOT subdirectory under cvsroot. The following files are CVS configuration files.

There are a series of files with ls / cvsroot / CVSROOT. Their uses are as follows:

checkoutlist supports other management files in the CVSROOT directory, allowing for the setting of various CVS commands Information

commitinfo When the cvs commit command is executed, this file specifies the command to be executed when the file is submitted.

Cvswrappers Defines a wrapper program that will be executed when the file is registered or retrieved.

Editinfo allows you to log the log information before the commit command starts The executed script

history tracks all commands that affect the warehouse.

Loginfo is similar to coimmitinfo, only after the file is submitted. Executing

modules allows you to define a symbol for a group of files, otherwise you must specify the path name of the cvs repository for each file to be referenced ($ CVSROOT).

Nitify controls notifications from "" watch "". "" Watch "" by "" cvs watch add "" and "" cvs edit ""





Passwd default user passworld not stored files.

Set administrative privileges:

γ€€γ€€γ€€source files and directories under the administrator should set up warehouses right permissions to control access to all RCS files (ending in, v) is read-only, warehouse. the directory should have the right to write to the user, in order to allow it to change.

more 3.2.2 build software library

if you have several development team, they work without this coherent, you can create several different software libraries .All you have to do is to redefine the environment variable CVSROOT, or use -d to set, the advantage of using multiple software libraries is that they can be on different sever, CVS version 1.0 can not use a command to change from Take out the files from the software library, and in later versions, you can take the source code on different SEVER to your working directory. The following is an example of how to create a working directory under multiple software libraries:

cvs -d server1: / CVS CO dir1

cd dir1

CVS -d server2: / root CO SDIR

CVS Update

the first command creates a working directory, remove the file out in the third command software library on sever2 in the sever1 Some files and then use all of the files on the file sever2 upgrade.

Backup and Mobile 3.2.3 software library of

backup software library files and other backup files is no different, but you need a backup tool to open locked CVS. Such , You must first register a user who can read the software library, open the CVS software library, you need to edit the '# cvs.rfl' file.

When you want to use a backup soft library to restore the original library, if the original library You have made changes after your backup. CVS will report an error. You must follow the steps below

? Get a new working directory

? Copy the file that failed the last commit (of course, you can't copy the CVS directory file)

? Work in the new directory, use commands such as cvs update or cvs diff to point out those changes, and use cvs commit to save the changes to the software library.

If you want to move a software library to another place, it is also very simple. The easiest way is to create a new directory to the directory you want to move. If you want to reuse the original directory, you can only modify it manually. CVS / repository and `` CVS / Root, unless you're good at this, it is not advisable to use.

remotely using 3.2.4 software library into the next section we explain in detail the

remote user's management 3.3CVS
as a CVS server, Two points should be satisfied. First, ensure that the software library has enough space. Second, ensure that there is no less than 32M of memory. The server generates two processes for each user connected to it, and the cost of the child process is small. But if the network The bandwidth is not enough, and the cost on the parent process is huge.

Another large cost is the diff file. When the source file is large, the cost of verifying or detecting him is also large.

3.3.1 Below we have general Rsh used for remote login as an example, to talk about the way the remote user's login authentication:

Cvs of the server should use rsh allows the user to configure .rshosts connection, assuming that the user on the remote host tom.exsample.com tom need to be connected to funame.simple .com works on this cvs server. You should edit the .rshosts of the bach directory on the server side, add

Tom.exsample.com to the tom

client to run rsh –l bach funame.simple.com 'echo @PATH

Make sure that you can connect to the CVS server, and the customer should write the displayed path to .bashrc or cshrc (instead of .logiin or .profile.)

In addition, the client can also define the environment variable CVS_SEVER. To define The location of the host. On the server side, modify the /etc/ineted.conf file to tell the server to run cvssever when getting a specific port connection. The default value of this port number is: 2041. Of course, in order not to use it every time All settings must be set and can be used on the user side by defining the environment variable CVS_AUTH_PORT.

If the client's ineted allows the original call, just add the following sentence to the /etc/ineted.conf file to 2401 stream tcp nowait root / usr / local / bin / cvs cvs –f –allow –root = / cvsroot pserver

You can also use the-T option to define the buffer directory.

β€”allow – root defines the software library available to users, if there are more on the server The software library needs to re-use this sentence. In addition, internal users can define the environment variable CVSROOT like this

: pseve: usr@funam.simple.com: / cvsroot

where usr is the user name (Linux system) funam.simple.com is the cvs server, and it is assumed that / cvsroot is the directory name of the software library. Remote users can use the following form::

etx: psever: usr@funam.silple.com: / cvsroot

: etx: It is defined as a remote user, and the rest is the same as above.

If the client's ineded uses general calls, only in / etc / seveice Add the following sentence:

cvspsever 2401 / tcp

restart ineted to read the initialization file.

CVS manages users. In the default state (such as logging in with telnet), it uses the same username and password as the Linux system. That is: as long as you Log in to the linux system and have read-only permission to $ CVSROOT. Of course, for a software developer, you must have read and write permissions to the corresponding directory to complete the source code upgrade and other work. Therefore, CVS also provides Own user authentication system to manage users more conveniently.

There can be a passwd file (which can be defined with environment variable CVS_PASSFILE) under $ CVSROOT / CVSROOT on the server side to record user information of cvs. He uses linux etc / Passwd is organized in the same way. Similarly, its passwold is also encrypted by the Linux standard. The following is the content of a passwd

anyone:

tom: xyzkue

mary: yuio: pubcvs The

first line means that when logging in as anyone, No password is required. You can even type in an empty string. Of course, in this way, you may only get read-only rights. The second line means that you need to type passwold when tom login The encrypted passworld is xyzkue. After logging in this way, you can generally get higher permissions. The
third line means that when Mary logs in, you need to type in the password. Enter the same software library as the system user. The purpose is because .cvs will record all the actions of its users in the software library. Define different identities with system users. Use cvs.

For example; using the user tom can log in in the following way:

$ cvs --d: etx : tom@funam.simple.com: / cvsroot login

(If the username tom is the same internally at the remote end, tom @ can also be omitted)

At the same time, you can use cvs loginout to revoke all environment variables.

3.3.2, using GASSAPI to access

CVS also supports TCP using GASSAPI direct access before using safe transfer, need to be recompiled CVS GASSAPI the support. -with -gassapi use connected, or connected with the -a option always use the authentication mode room GASSAPI a manner identical.

but at the time of login is required to redefine as $ CVSROOT:

$ CVS -d: gsever: usr@cvssever.com: / CVSROOT Login

3.3.3 kerberos is directly connected

simplest use rsh method described above, said primary method. The feature is that all data is passed through an extra program. It is very time-consuming. If kerberos is installed. You can connect directly with TCP.

Also CVS needs to be recompiled to get keberos support. You can use --with-krb4 to connect. This way the transmitted data is not encrypted. If you want to obtain security. must be connected to the server and the client `` --enable-encryption. at this point, you apply common variable -x to request encryption.

required on the server side Editing inetd.conf to run cvs kserver client's default port number is 1999, if you want to use a different port number to be defined at the user end CVS_CLIENT_PORT..

At this point login command should be

cvs -d: kserver: faun.example.org: / usr / local / cvsroot checkout foo

3.3.4 connect with fork

In this way, you can connect to the software library of the local hard disk through a remote protocol. In other words, he can have the same function as: local: The login command in this way is

cvs -d: fork: / usr / local / cvsroot login

and with: etx: host name is the same as the default cvs.

4 cvs server racks and application examples

4.1 server installation configuration

assume that there are currently a work project, code needs to be administrator with the cvs internal development team is three people, an ip respectively. Yes: 192.168..1.2 (user name t1), 192.168.1.3) (user name t3), 193.168.1.3 (user name t3), one remote user, the host is tom.example.com. (User name is tom )

If you have installed cvs, it is very simple to set up a cvs server with cvs.exam.org. The steps are roughly as follows:

1) Log in as root. Create a repository (repository)

$ export CVSROOT = / cvsroot

$ mkdir / cvsroot

$ cd / cvsroot

$ cvs init

2) Set execution permissions

$ chmod / cvsroot / CVSROOT 744 (/ ccvsroo / CVSOOT is set to read-only)

$ chmod / cvsroot 764 Group number (/ cvsroot can be read and written by the development group)

3) Modify files In order to facilitate others to use, because the development team members are system users, so use the system here Username and password are better. First edit. The rhosts file is as follows:

tom.example.com. tom

modify the /etc/inetd.conf file on the server and add the following sentence

2401 stream tcp nowait root / usr / local / bin / cvs cvs -f --allow-root = / usr / cvsroot pserver

In this way, a basic cvs server is built.

We only provide a basic application here. The real details of cvs are very complicated. We only introduce some introductions. Friends who are interested can read it carefully. Installation document.

4.2 Application example

(using the cvs system on the host, you can telnet to the host, and then use it, and there is no difference with the local use, so this article has not mentioned it)

suppose that the tom in the above example wants to use the cvs system on the cvs host To develop with everyone. First it configures some of its own environment variables. First edit / etc / services to add:
cvspserver 2401 / tcp

and then add the following code

CVSROOT =: etx: psever: tom@cvs.exam in the .profile file . ORG: / cvsroot

Export CVSROOT

so that he can log in using $ cvs login here we will use concrete examples to talk about tom is cvs applications and other linux commands as there are plenty of .cvs. Numbers. I will make a list of what the next section.

Tom has the following files in / usr / test directory

Ecample.c exampl2.c tes1.c test2.c utimel.c tty.c

If you want to create your own directory in the software library

$ cd / usr / test

~ test $ cvs import –m β€œtom first creation” tomdir tom tomwork

N tomdit / example.c

N tomdit / exampl2.c

N tomdir / test1.c

N tomdir /test2.c

N tomdir / utmel.c

N tomdit / tty.c

No conflicts creat by this import

command description import submit command --m followed by a description. tom Publisher tomwork is the release label. If you are prompted that CVSROOT is wrong, you can use-- d Add CVSROOT

γ€€

Note: All cvs commands can be helped by cvs command --H. At this time, there is an additional tomdir subdirectory under the / cvs directory on the server side. Contents:

example.c, v exampl2.c, v test1.c , v test2.c, v tty.c, v utimel.c, v are now

submitted for the first time. In

this way, you do n’t have to worry about deleting the test directory accidentally. Use the following command to check out the source files Backup

$ / cd usr

`` usr $ / cvs checkout test tomdir-r 1.1

U test / exsample.c

U test / exampl1.c

U test / test1.c

U test / test2.c

U test / tty.c

U test / ulnem.c

cvs checkout command default is to get the latest version. We can also get an old version, this command is tomdir 1.1 The version of the code is taken out. After recovery, a CVS directory is added for management, so that when you next commit or modify, it will interface with the management file on the server to ensure that the version is good. This example is very small and realistic It is very likely that there are many files in the project, so you can restore the CVSROOT module first

~ usr / $ cvs checkout CVSROOT / mouldes

~ / usr / $ vi CVSROOT / mouldes edit the module name, such as we add

src project / src

print project After / src / print

cvs commit

, we can use cvs checkout print instead of

cvs checkout project / src / print

. After editing, you can submit the file

~ usr / $ cvs commit –m β€œedit of mouldes name” CVSROOT / mould can be restored except You can also restore a single file or module after the entire directory

~ usr / test / $ cvs checkout –m "newer file" tty.c

After restoring the file, tom can use various editors to modify and repair the source file After the change is completed, you can submit its work results

~ / usr / cvs commit test tomdir. In

this way, tom completes an upgrade of the source file. Other similar

methods can be obtained 4..3 Related technologies

in management 4.3.1 A technology in managing source files is called " "Keyword Replacement" ". After each execution of the" "cvs commit" "operation, some keywords in the source file will be replaced with the available words

$ AUTHOR $ username

$ Data $ the time of registration

$ Header $ standard The first part contains the full path name, date, and author

$ Id $ of the RCS, except for the incomplete RCS file name, which is the same as $ Header $.

$ Log $ contains the full path name, version number, date, author, and the RCS provided when submitting Log information.

$ RCSfile $ contains the file name of the RCS, excluding the path name

$ Revision $ The assigned version number

$ Source $ The full name of the RCS file

$ State $ The state of the assigned version, assigned by cvs admin -s.

Example: In Before cvs commit, there is

static char * rcsid = "" $ Id $ ""

in

main.c ; after cvs commit, the change of main.c becomes:

static char * rcsid = "" $ Id: main.c, v 1.2 1999/04/29 15:10:14 trimblef Exp $ "";
Of course, here is just a demo.In actual program development, this technology has a very useful effect, so I won't go into details here. Interested friends can refer to related books.

4.3.2 Creating a branch allows users to modify some files using the command commit without affecting the trunk. To create a branch, you should first create a tag for those files that you want to modify. The

tag is assigned to a file or a group of files Symbol. In the life cycle of the source code, the files that make up a group of modules are assigned the same tags. After executing

~ usr / teat / $ cvs tag release-1-0

tag creation in the working directory , you can create it One branch:

~ usr / teat / $ cvs rtag -b -r release-1-0 release-1-0-path print

-b: create branch

-r release-1-0: specify the existing label

releas-1-0 -patch: branch

print: module name

using cvs update -j option to change the local file copy of the merger on the branch.

~ usr / teat / $ cvs update -j Release-1-0 print.c

source file mutatis mutandis after, you can delete the local working copy with cvs release

and inform other developers no longer use this module.

~ use / $ cvs release -d the Test

4.3.3 to resolve conflicts

when there are multiple users make changes to the same file, if you modify the The same part of it, and if the revised content is not Then, conflict is inevitable.

For example, there is a file test.c in the CVS file repository, and its version is 1.4. User A first checks out the file for modification, and later user B checks out the file for modification and submits it to 1.5 in advance. When user A resubmits, there will be a conflict. At this time, CVS will prompt that it needs to be resolved manually.

For example, version 1.4 in the file repository: The content is:

#include

main ()

{

int i;

for (i = 0; i <100; i ++)

printf (β€œCount:% d”, i);

}

User B 1.5:

#include

main ()

{

int i;

for (i = 0; i <10; i ++)

printf (β€œCount:% d”, i);

printf (β€œOver”);

}

User A:

#include

main ()

{

int i;

for (i = 0; i <50; i ++)

printf (β€œCount:% d”, i);

return;

}

There will be a conflict when submitting, which requires manual editing. At this time, if user A runs $ cvs update and then edits test.c, you will see the content of test.c like this:

#include

main ()

{

int i ;

<<<<<<< test.c

for (i = 0; i <50; i ++)

=======

for (i = 0; i <10; i ++)

>>>>>>> 1.5

γ€€

printf ("" Count:% d "", i);

<<<<<<< test.c

return;

=======

printf ("" Over "");

>>>>>>> 1.5

} In

this way, it is necessary to manually modify according to different tasks, which is more troublesome, so in real collaborative development, very few, give the same file, many people have the same submit permissions.

4.3.4 file version management

version management system, the most important is the management of file versions, the default version upgrade using a certain amount of time if due to special needs, to define your own version of a file, you can use the following command:

cvs log [-lR] [-r rev] [-d date] [-w login] [files…]

Among them, the meaning of the parameters is as follows:

-l do not process subdirectories

-R do the same for subdirectories

-r specifies the version number

-d specified time

-w specifies the login name

use the following command to see all the historical version number or version information specified file the current module.

cvs annotate [-lR] [- r rev | -D date] files

wherein the parameters have the following meaning:

-l not processed subdirectories

-R subdirectories do the same process

-r version number specified

command can be used below with reference to the specified file (After checking out) all modified information.

The

output of $ cvs annotate cvstest / c / test.c is as follows: version modifiers modified time source code

1.1 (tang 18-Jan-00): #include

1.1 (tang 18-Jan-00): #include

1.1 (tang 18- Jan-00):

1.1 (tang 18-Jan-00): main ()

1.1 (tang 18-Jan-00): {

1.1 (tang 18-Jan-00): int i = 0;

1.1 (tang 18-Jan -00):

1.1 (tang 18-Jan-00): for (i = 0; i <20; i ++)
1.1 (tang 18-Jan-00): printf ("" Count:% d "", i);

1.1 (tang 18-Jan-00):

1.3 (tang 18-Jan-00): printf ("" 222222 "");

1.4 (tang 18-Jan-00): printf ("" 333333 "");

1.1 (tang 18-Jan-00):}

Use The following command can generate a branch version relative to a specified major version:

cvs rtag –b –r rev_root rev_branch file_name

Among them, the meaning of the parameters is as follows:

-b specifies to generate a branch version

-r specifies the trunk node version number of the

branch the version number

rev_branch branch version

file_name specified file, the "." indicates all files in the current directory

using the following command to generate a branch version corresponding to the version number, because the CVS version number is numerically expressed, and in the same module The versions of different files may be completely different, so it is more convenient to use the logo.

Example:

$ cvs rtag –b –r 1.2 tlb-1 SOURCE

To access the branch version later, you can use the β€œ-r” option

$ cvs checkout –r tlb-1 SOURCE to

switch from the currently checked version to a branch version:

$ cvs update –r tlb-1 SOURCE

Use the following command to view the version information:

cvs status [–vlR] files

Among them, the meaning of the parameters is as follows:

-v displays all the information

-l does not display the sub directory information

-R Displays subdirectory information

command: cvs update -j rev module changes made to the current version of the file with the specified merge.

For example: trunk 1.1 1.2 1.3 1.4 1.5 1.6 ↓

branch tlb-1 1.2.2.1 1.2.2.2 1.2.2.3

If you want to merge the version on branch tlb-1:

$ cvs update –j 1.2.2.3 –j tlb-1 test.c

Among them, 1.2.2.3 can generate an easy-to-remember logo through the tag command.

If you want to merge branch tlb-1 to the trunk 1.2:

$ cvs update –j tlb-1 test.c

if you want to merge different versions on the trunk (note that the order is important, and all changes between the specified versions will be discarded) :

$ Cvs update –j 1.5 –j 1.2 test.c

If the file of the module changes between different versions, you can:

$ cvs update –A

$ cvs updata –jbranch_name

5, command set

In the examples in this chapter, many are introduced. The detailed usage of commands is mostly analyzed from the perspective of application. In fact, cvs has a large number of commands. Like gcc, there are not many common commands for cvs. In this section, we list some commonly used commands. Try not to duplicate the introduction in the above sections. Of course, limited to time and level, it is impossible to list all the commands of cvs. Interested friends. Yes , Reference, cvs documentation, and linux man documentation, detailed study, you can also come here to give guidance

(1) check out the source file

cvs checkout [-r rev] [-D date] [-d dir] [- j merg1] [-j merg2] modules

significance where the parameters are as follows:

-R & lt detection module specified version

-D date specified detection module

-d specified directory instead of the detection module

-j specified version and the current version of combined

use of The following command will check out the module just generated and generate the same directory structure in the current directory as in the file repository:

usr $ cvs checkout project

usr $ cvs checkout project / src / main

cvs checkout For detailed usage, see cvs -H Checkout output.

2) CVS commit command After the modification of the file is completed, use cvs commit to submit to the warehouse.

Cvs commit -m "" Update by xxxxx "" project

cvs commit -m "" Update main.c "" main.c

After the submission is complete, the current version number will be updated, such as the original 1.1, now 1.2. Both versions are on the main trunk of the warehouse. The

-m option can record comments about the submission. If the -m option is not specified , The editor specified in the environment variable CVSEDITOR is called (vi is the default), prompting to enter text, modify the record comment.

3) delete, add, rename files and directories
cvs add [-k kflags] [-m message ] files ...

which the meanings of the parameters are as follows:

after -k to specify the default directory of the file detected

-m description of the file

above command will add a new file to the warehouse, but until it is used to submit order Only then will the file warehouse be truly updated.

cvs remove [options] files The

above command will delete files from the file repository, but they will not be effective until submitted.

Example 1: Add file

$ cvs checkout SOURCE

$ cd cvstest / c

$ touch test.c

$ cvs add test.c

$ cvs commit –m β€œadd test.c”

Example 2: Delete file

$ cvs checkout SOURCE

$ cd cvstest / c

$ rm test.c

$ cvs remove test.c

Use the –f option to make the above two steps together.

$ cvs remove –f test.c

If you want to restore the file you just deleted before submission, you can do the following:

$ cvs add test.c

If you only performed the first step of deletion (rm), you can use the following method to restore:

$ cvs update test.c

For the renamed file, you can delete and then add it.

For the modification (renaming) of the directory, you may need to modify the cvs management file. In general, you should follow the following steps: Assuming that tom is modifying part of the file, I want to merge and update my local copy (checkout) and the modification made by another person has been placed in the warehouse), available

~ usr / test / $ cvs update

to confirm that all relevant changes have been submitted;

enter the file you want to modify the warehouse module directory, the corresponding directory modifications (rename or delete)

$ cd $ CVSROOT / modules

$ mv old_dir new_dir

If necessary, modify the management files, such as the modules file, if you want to delete the directory, you should first delete each file in the directory (including using cvs remove) after processing the above steps 2 steps.

(4 Submit source

CVS the commit [-Rl] [- m mesg] Files

-R & lt submitted with the subdirectory even

-l submit only local directory (subdirectory is not submitted)

-m annotation information

after the detection of the source files in the working directory All changes to the source file in the file must be submitted before the source file in the file repository can function, and the new file can be assigned a new version number.

(5) Release the working directory

cvs release –d SOURCE

This command will delete the working directory cvstest / c (it is recommended to perform this step after submitting the modified module), it is better than using rm –rf cvstest.

In this introduction, the use cvs server. Commonly used in parallel development. Command. Hope to play a role in better ideas

πŸ¦‘ Summary

This UNDERCODE TUT introduces some knowledge of version control. Several do with the control system. And from the perspective of ease of use , Tells the process of constructing a cvs server on a linux machine, and cvs is a simple way to use

cvs. It can also be said to be a network application. Its function is that it can provide simultaneous development for multiple users under parallel conditions. , Convenient and safe source code. Management model. Personally think that the emergence of cvs is the inevitable product of free Linux.

He will also get more promising development in this hot spot of Linux.

WRITTEN BY UNDERCODE
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
πŸ¦‘ EXPERT HACKING TIPS BY UNDERCODE