사이드바 영역으로 건너뛰기

게시물에서 찾기로이쿤

28개의 게시물을 찾았습니다.

  1. 2006/07/17
    영어 문장 10개 외우기
    로이쿤
  2. 2006/07/13
    history관련 cvs protocol
    로이쿤
  3. 2006/07/13
    directory 관련 유용한 tips
    로이쿤
  4. 2006/07/13
    cvs명령어 import와 co(checkout)
    로이쿤
  5. 2006/07/13
    ls, rls를 지원하지 않는 cvs에서 모듈 목록 가져오기
    로이쿤
  6. 2006/07/13
    CVS 승인 과정
    로이쿤
  7. 2006/07/13
    PatchHelper 기획
    로이쿤
  8. 2005/12/02
    진보넷 블로그 만든 날...
    로이쿤

영어 문장 10개 외우기

How should I address you? 뭐라고 부를까요? 
I know him inside and out. 저 그 사람 잘 알아요. 
How many are there in your family?
I'm afraid I've got to go now.
I'm sorry to have kept you waiting so long.
I messed it. I'm sorry. I screwed it up. 내가 일을 망쳤어요.
I hope I didn't piss you off. 내가 너를 화나게 한 게 아니었으면 해.
That's another pair of shoes.
I can't make heads or tails of it.
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

history관련 cvs protocol

 

다음을 통해 history를 얻어올 수 있다

 

 sendCommand("Directory ."); // local dir
 sendCommand(m_CVSRoot); // serv dir ??
 sendCommand("Argument -x"); // report형식
 sendCommand("Argument O"); // check out만 뽑아옴
 sendCommand("Argument -a"); // all user
 sendCommand("Argument -p"); // rep 지정
 sendCommand("Argument " + m_CVSRoot); // rep 이름
 sendCommand("history ");

 

맨 위의 두 문장이 들어가야 명령이 먹힌다는 것에 주의!

잘못된 옵션을 입력해보면 각 옵션에 대한 설명을 얻을 수 있음.

옵션은 cvs 프로그램의 옵션과 거의 같음.(틀린건 아직 못봤음..)

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

directory 관련 유용한 tips

 

dir 생성

 

 CreateDirectory("dir이름",0);

 

dir 제거

 

 removeDirectory는 파일이 있거나 하위폴더가 있는 dir을 지우지 못함. system call이 강력.

 

 string command = "rd /S /Q "";
 string rd = "dir이름";
 string sysComm = command + rd;
 system(sysComm.c_str());

 

dir 이동과 복귀

 

 char cwd[1024];
 
 if ( GetCurrentDirectory(1024, (LPTSTR)cwd) != 0)
 {
  if ( SetCurrentDirectory(".\temp") )
  {

 

   //... 이동후 할일들

 

    SetCurrentDirectory(cwd);
  }
 }

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

cvs명령어 import와 co(checkout)

각 명령어의 형식을 알아보면

 

import

 

   ss << "cvs -d:pserver:"<< m_Id << "@" << m_ServerName << ":" << m_CVSRoot // server
    << "import " // command
    << "-m "for PatchHelper"" // message
    << "-- PHStd avendor arelease"; // module이름과 추가로 주어야 하는것들...

 

check out

 

   ss << "cvs -d:pserver:"<< m_Id << "@" << m_ServerName << ":" << m_CVSRoot // server
    << "co " // command
    << "-P -- PHStd"; // -P는 Prune empty directory -- 다음에는 module이름

 

 

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

ls, rls를 지원하지 않는 cvs에서 모듈 목록 가져오기

 

사실 co -c 가 있는데 이역시 서버 관리자가 모듈을 module/ 안에 넣지 않았으면 사용할 수 없다.

따라서 이런 경우를 위해서 많은 방법을 생각해보았는데 결론은 root의 history를  parsing하는 것이었다. 모듈이 import되어서 버젼관리가 되기 위해서는 반드시 check out 되어야 하는데, import는 남지 않지만 check out은 history에 남게 되어있다.

따라서 이러한 check out정보를 parsing하면 모듈들의 목록을 얻을 수 있다.

 

단 history정보를 서버가 보낼때 각 element의 구분을 space로 하는 문제가 있다.

따라서 파일이나 폴더의 이름에 공백이 들어가는 경우 많은 예외의 경우가 생기게된다.

 

하지만 root의 history는 모듈의 history와 조금 다르다.

root의 경우에는 좋은 점이 폴더 이름의 앞뒤에 '='를 넣어서 보내준다.

따라서 이를 기준으로 모듈 이름을 얻을 수가 있다.

하지만 파일이름에 '='들어가는 경우를 생각하면 이조차 예외가 생긴다.

 

이러한 경우를 해결하기 위해서 두가지 점에 초점을 맞춘다.

1. 폴더이름의 앞뒤에 ' ='를 넣어준다는 점

2. 줄을 맞추기 위한 space를 넣어준다는 점

 

이중에 중요한 것은 바로 2번인데 줄을 맞춘다는 것은 각 line에서 각 element의 시작 위치가 동일하다는 것을 의미하기 때문이다. 따라서 우리가 확신할 수 있는 이름의 모듈을 알고 그것을 기준으로 시작위치를 찾아서 파싱하면 정확한 파싱이 가능하다.

 

이를 위해서는 의미없는 모듈을 import하고 check out할 필요가 있다.

그리고 이 이름에 해당하는 data는 반드시 '='가 2개가 들어간 것중에서 찾아야 완벽히 정확하다.

이러한 까다로운 조건을 모두 만족시키면 완벽한 모듈이름 찾기가 가능하다.

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

CVS 승인 과정

승인 과정은 다음과 같다

 

 //승인 시작
 sendCommand("BEGIN AUTH REQUEST");

 //CVS루트 입력
 sendCommand("/cvs");

 // user name 입력
 sendCommand(id);
 // password 입력
 sendCommand(getEncPasswd(passwd));

 // 승인끝
 sendCommand("END AUTH REQUEST");

 

암호는 암호화를 해야하는데 아주 단순한 알고리즘이다.

아래 글을 열면 암호화 테이블이 있는데 각 문자마다 고유한 int가 존재하는데

그 int값에 해당하는 char로 치환해주고 앞에 'A'만 붙이면 된다.



3. How to Connect to and Authenticate Oneself to the CVS server

Connection and authentication occurs before the CVS protocol itself is started. There are several ways to connect.

 

server
If the client has a way to execute commands on the server, and provide input to the commands and output from them, then it can connect that way. This could be the usual rsh (port 514) protocol, Kerberos rsh, SSH, or any similar mechanism. The client may allow the user to specify the name of the server program; the default is cvs. It is invoked with one argument, server. Once it invokes the server, the client proceeds to start the cvs protocol.

 

kserver
The kerberized server listens on a port (in the current implementation, by having inetd call "cvs kserver") which defaults to 1999. The client connects, sends the usual kerberos authentication information, and then starts the cvs protocol. Note: port 1999 is officially registered for another use, and in any event one cannot register more than one port for CVS, so GSS-API (see below) is recommended instead of kserver as a way to support kerberos.

 

pserver
The name pserver is somewhat confusing. It refers to both a generic framework which allows the CVS protocol to support several authentication mechanisms, and a name for a specific mechanism which transfers a username and a cleartext password. Servers need not support all mechanisms, and in fact servers will typically want to support only those mechanisms which meet the relevant security needs.

The pserver server listens on a port (in the current implementation, by having inetd call "cvs pserver") which defaults to 2401 (this port is officially registered). The client connects, and sends the following:

 

  • the string `BEGIN AUTH REQUEST', a linefeed,
  • the cvs root, a linefeed,
  • the username, a linefeed,
  • the password trivially encoded (see 4. Password scrambling algorithm), a linefeed,
  • the string `END AUTH REQUEST', and a linefeed.

The client must send the identical string for cvs root both here and later in the Root request of the cvs protocol itself. Servers are encouraged to enforce this restriction. The possible server responses (each of which is followed by a linefeed) are the following. Note that although there is a small similarity between this authentication protocol and the cvs protocol, they are separate.

 

I LOVE YOU
The authentication is successful. The client proceeds with the cvs protocol itself.

 

I HATE YOU
The authentication fails. After sending this response, the server may close the connection. It is up to the server to decide whether to give this response, which is generic, or a more specific response using `E' and/or `error'.

 

E text
Provide a message for the user. After this reponse, the authentication protocol continues with another response. Typically the server will provide a series of `E' responses followed by `error'. Compatibility note: CVS 1.9.10 and older clients will print unrecognized auth response and text, and then exit, upon receiving this response.

 

error code text
The authentication fails. After sending this response, the server may close the connection. The code is a code describing why it failed, intended for computer consumption. The only code currently defined is `0' which is nonspecific, but clients must silently treat any unrecognized codes as nonspecific. The text should be supplied to the user. Compatibility note: CVS 1.9.10 and older clients will print unrecognized auth response and text, and then exit, upon receiving this response. Note that text for this response, or the text in an E response, is not designed for machine parsing. More vigorous use of code, or future extensions, will be needed to prove a cleaner machine-parseable indication of what the error was.

If the client wishes to merely authenticate without starting the cvs protocol, the procedure is the same, except BEGIN AUTH REQUEST is replaced with BEGIN VERIFICATION REQUEST, END AUTH REQUEST is replaced with END VERIFICATION REQUEST, and upon receipt of I LOVE YOU the connection is closed rather than continuing.

Another mechanism is GSSAPI authentication. GSSAPI is a generic interface to security services such as kerberos. GSSAPI is specified in RFC2078 (GSSAPI version 2) and RFC1508 (GSSAPI version 1); we are not aware of differences between the two which affect the protocol in incompatible ways, so we make no attempt to specify one version or the other. The procedure here is to start with `BEGIN GSSAPI REQUEST'. GSSAPI authentication information is then exchanged between the client and the server. Each packet of information consists of a two byte big endian length, followed by that many bytes of data. After the GSSAPI authentication is complete, the server continues with the responses described above (`I LOVE YOU', etc.).

 

future possibilities
There are a nearly unlimited number of ways to connect and authenticate. One might want to allow access based on IP address (similar to the usual rsh protocol but with different/no restrictions on ports < 1024), to adopt mechanisms such as Pluggable Authentication Modules (PAM), to allow users to run their own servers under their own usernames without root access, or any number of other possibilities. The way to add future mechanisms, for the most part, should be to continue to use port 2401, but to use different strings in place of `BEGIN AUTH REQUEST'.

자료 얻은 곳 .. cvs protocol에 대한 자세한 설명을 볼 수 있음.

http://www.delorie.com/gnu/docs/cvs/cvsclient_3.html


진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

PatchHelper 기획

회사에서 큰 프로젝트는 cvs나 svn과 같은 버젼 관리시스템을 쓰기 마련이다.

cvs보다는 svn이 개정된 것이라고는 하지만

두 관리시스템의 구조가 너무나 차이가나서

cvs에서 원래 작업을 하던사람들은 쉽게 svn으로 옮기지를 못한다.

 

현재 Theos는 cvs를 통한 버젼관리를 하고 있는 상황이다.

svn이었으면 더 좋았겠지만 아무튼 cvs라는 상황에서 시작된 프로젝트이다.

 

이 프로젝트은 cvs에서 수정된 파일들을 원하는 형식으로 자동으로 압축해주는 프로그램이다.

현재 Theos를 비롯한 아라마루 게임들은 넷마블에서 퍼블리싱을 하는데, 넷마블로 수정본을 배포를 하는 경우에 정해진 형식으로 압축파일을 만들어줄 필요가 있다.

이러한 것을 손으로 하는 것이 아닌 프로그램으로 한다면 패치를 하는데 많은 편함이 있을것이다.

이 프로젝트를 진행하면 cvs의 사용에 대한 여러가지 이해, MFC의 활용에 대한 공부도 될 것이다.

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

진보넷 블로그 만든 날...

블로그 뭘 쓸까... 고민고민하다가 일단 고른게 진보넷 블로그

이전에 만들었던 블로그도 있었지만... 맘에 안들었고...

이번엔 진보넷으로 온것이다..

맘에 들지 안들지는 지켜봐야겠다...ㅋ

진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크