getgrent】的更多相关文章

http://baike.baidu.com/link?url=JNyoNvukL-LP7ayYlNNWLv2gPOzn-bjiwuX1CE_QwUTyrRGCWu4NhDW-JznHQoG4aIfwaA2iohylA5iqVG2PIq getgrent 头文件 编辑 #include<grp.h> #include <sys/types.h> 函数原型 编辑 struct group *getgrent(void); 函数说明 编辑 getgrent()用来从组文件(/etc/g…
一.口令文件 UNIX口令文件包含下表中的各个字段,这些字段包含在 由于历史原因,口令文件是/bin/passwd,而且是一个文本文件,每一行都包括了上表中的七个字段,字段之间用":"分隔,例如一个文件中可能有以下三行: root:jheVopR58x9Fx:0:1:The superuser:/:/bin/sh n o b o d y : * : 6 5 5 3 4 : 6 5 5 3 4 : : / : stevens:3hKVD8R58r9Fx:224:20:Richard St…
[a] getpwent / setpwent / endpwent #include <pwd.h> struct passwd *getpwent(void) //成功返回指针,出错或到过文件末尾返回 NULL void setpwent(void) void endpwent(void) struct passwd { char *pw_name; char *pw_passwd; //口令 uid_t pw_uid; gid_t pw_gid; char *pw_geos; //用户信…
转自:http://net.pku.edu.cn/~yhf/linux_c/function/07.html endgrent(关闭组文件) 相关函数 getgrent,setgrent 表头文件 #include<grp.h>#include<sys/types.h> 定义函数 void endgrent(void); 函数说明 endgrent()用来关闭由getgrent()所打开的密码文件. 返回值   附加说明   范例 请参考getgrent()与setgrent().…
这是标准的Perl解释器所支持的所有重要函数/功能的列表.在一个函数中找到它的详细信息. abs - 绝对值函数 accept - 接受传入的socket连接 alarm - 调度一个SIGALRM atan2 -Y/X的反正切值,范围在-PI到PI bind - 地址绑定到一个套接字 binmode - 准备二进制文件I / O bless - 创建一个对象 caller - 获取当前子程序调用的上下文 chdir - 改变当前的工作目录 chmod - 改变权限的文件列表 chomp - 从…
密码文件 密码文件又称用户数据库,一般为/etc/passwd,对应的结构为struct passwd,该文件内容大体如下: 描述 passwd字段 用户名 char* pw_name 加密密码 char* pw_passwd UID uid_t  pw_uid GID gid_t  pw_gid 注释 char* pw_gecos 初始工作目录 char* pw_dir shell char* pw_shell 加密密码一般一个字符,如果没有值说明该用户没有密码,这个字符只是表象,不是真正的加…
第1章 unix基础知识 1. char *strerror(int errnum) 该函数将errnum(就是errno值)映射为一个出错信息字符串,返回该字符串指针.声明在string.h文件中. 2.void perror(const char *s) 该函数基于当前的errno值,在标准出错文件中输出一条出错消息,然后返回.声明在stdio.h文件中.它首先输出由s指向的字符串,然后是一个冒号,一个空格,接着是errno值对应的出错信息,最后是一个换行符. 第2章 UNIX标准化及实现…
1,user groups 篇幅 the length of an article; fgetgrent(从指定的文件来读取组格式) 相关related functions;fgetpwent headers files includes: #include <grp.h> #include <sys/types.h> function define: struct group * getgrent(FILE * stream); 函数说明fgetgrent()会从参数stream…
Emacs 24.3出来好久了,但是在Debian 7里还是Emacs 23的版本. 以下是安装步骤(9步): -dev libncurses5-dev autoconf automake texinfo sudo apt-get build-dep emacs git clone git://git.savannah.gnu.org/emacs.gitcd emacs/ git checkout emacs-24.3 git checkout -b custom_branch ./autoge…
这一章主要介绍了口令文件和组文件的结构和一些围绕这些结构的函数. 口令文件即passwd就是在/etc/passwd中可以查阅.其结构是: 上图四个平台能支持的就用黑点表示. 因为加密口令这一项放在passwd这个人人可读的文件中,可能会有安全问题.所以现在的Linux中的加密口令都是放在/etc/shadow中,只有root用户才可以查看.而在passwd文件中加密口令这一项则显示为x.(每一项都是用冒号隔开的) POSIX.1就定义了两个函数来让我们获取用户名或者数值用户ID. #inclu…