1 / 4

Chapter 3

Chapter 3. /etc/passwd real uid( 진짜 사용자 식별번호 ), real gid( 진짜 그룹 식별번호 ) 프로세스를 수행시킨 사용자의 사용자 식별번호 / 그룹 식별번호 effective uid( 유효 사용자 식별번호 ), effective gid( 유효 그룹 식별번호 ) 실제 소유권을 갖는 사용자의 사용자 식별번호 / 그룹 식별번호 file mode ( 읽기 , 쓰기 , 수행 ) rwxrwxrwx, rwxr-xr-x, 표 3.1 (p58) chmod 로 허가 수정

nyssa-casey
Télécharger la présentation

Chapter 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3 • /etc/passwd • real uid(진짜 사용자 식별번호), real gid(진짜 그룹 식별번호) • 프로세스를 수행시킨 사용자의 사용자 식별번호/그룹 식별번호 • effective uid(유효 사용자 식별번호), effective gid(유효 그룹 식별번호) • 실제 소유권을 갖는 사용자의 사용자 식별번호/그룹 식별번호 • file mode (읽기, 쓰기, 수행) • rwxrwxrwx, rwxr-xr-x, • 표 3.1 (p58) • chmod로 허가 수정 • 프로세스 생성시 그 프로세스를 시작시킨 사용자의 사용자 식별번호를 부여 • S_ISUID, S_ISGID, S_ISVTX • S_ISUID : 파일 소유자의 사용자 식별번호를 유효 사용자 식별번호로 부여 • 파일의 텍스트 이미지를 남겨둠

  2. Chapter 3 • file creation mask • filedes = open(pathname, O_CREAT, (~mask)&mode); • mask=07 0644-> 0640 • test1.c • int access(const char *pathname, int mode) • 유효 사용자 식별번호가 아니라 진짜 사용자 식별번호에 의해 파일에 접근할 수 있는지 여부 점검 • R_OK (호출 프로세스가 읽기 접근을 가졌는가?), W_OK (쓰기 접근), X_OK (수행시킬 수 있는가?) • test2.c • int chmod(const char *pathname, mode_t newmode) • int chown(const char *pathname, uid_t owner_id, gid_t group_id); • 파일의 소유자나 슈퍼 사용자만 사용할 수 있음 • int link(const char *orginal_path, const char *new_path); • unlink • int rename(const char *oldpathname, const char *newpathname); • int symlink(const char *realname, const char *symname); • int readlink(const char *sympath, char *buffer, size_t bufsize); • test3.c

  3. Chapter 3 • int stat(const char *pathname, struct stat *buf) • p73-74 stat 구조 int filedes, retval; struct stat s; filedes = open(“/tmp/dina”, O_RDWR); retval = stat(“/tmp/dina”, &s); retval = fstat(filedes, &s) • test4.c filedata.c • test5.c • Lookout • (실습) 파일의 크기 변화를 점검하는 프로그램으로 test5.c를 변경하라

More Related