Server IP : 127.0.0.2 / Your IP : 3.149.246.106 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/augeas/lenses/dist/ |
Upload File : |
(* Module: Passwd Parses /etc/passwd Author: Free Ekanayaka <free@64studio.com> About: Reference - man 5 passwd - man 3 getpwnam Each line in the unix passwd file represents a single user record, whose colon-separated attributes correspond to the members of the passwd struct *) module Passwd = autoload xfm (************************************************************************ * Group: USEFUL PRIMITIVES *************************************************************************) (* Group: Comments and empty lines *) let eol = Util.eol let comment = Util.comment let empty = Util.empty let dels = Util.del_str let word = Rx.word let integer = Rx.integer let colon = Sep.colon let sto_to_eol = store Rx.space_in let sto_to_col = store /[^:\r\n]+/ (* Store an empty string if nothing matches *) let sto_to_col_or_empty = store /[^:\r\n]*/ (************************************************************************ * Group: ENTRIES *************************************************************************) let username = /[_.A-Za-z0-9][-_.A-Za-z0-9]*\$?/ (* View: password pw_passwd *) let password = [ label "password" . sto_to_col? . colon ] (* View: uid pw_uid *) let uid = [ label "uid" . store integer . colon ] (* View: gid pw_gid *) let gid = [ label "gid" . store integer . colon ] (* View: name pw_gecos; the user's full name *) let name = [ label "name" . sto_to_col? . colon ] (* View: home pw_dir *) let home = [ label "home" . sto_to_col? . colon ] (* View: shell pw_shell *) let shell = [ label "shell" . sto_to_eol? ] (* View: entry struct passwd *) let entry = [ key username . colon . password . uid . gid . name . home . shell . eol ] (* NIS entries *) let niscommon = [ label "password" . sto_to_col ]? . colon . [ label "uid" . store integer ]? . colon . [ label "gid" . store integer ]? . colon . [ label "name" . sto_to_col ]? . colon . [ label "home" . sto_to_col ]? . colon . [ label "shell" . sto_to_eol ]? let nisentry = let overrides = colon . niscommon in [ dels "+@" . label "@nis" . store username . overrides . eol ] let nisuserplus = let overrides = colon . niscommon in [ dels "+" . label "@+nisuser" . store username . overrides . eol ] let nisuserminus = let overrides = colon . niscommon in [ dels "-" . label "@-nisuser" . store username . overrides . eol ] let nisdefault = let overrides = colon . [ label "password" . sto_to_col_or_empty . colon ] . [ label "uid" . store integer? . colon ] . [ label "gid" . store integer? . colon ] . [ label "name" . sto_to_col? . colon ] . [ label "home" . sto_to_col? . colon ] . [ label "shell" . sto_to_eol? ] in [ dels "+" . label "@nisdefault" . overrides? . eol ] (************************************************************************ * LENS *************************************************************************) let lns = (comment|empty|entry|nisentry|nisdefault|nisuserplus|nisuserminus) * let filter = incl "/etc/passwd" let xfm = transform lns filter