diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-15 15:19:20 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-08-18 10:05:38 +0300 |
commit | 3121834c53912f8a6bfcd4931bae9998bbb4a78d (patch) | |
tree | ec89b4df8e7536dd001862f7104032acbeb8b3de | |
parent | c53eb034bb53ea51bc299066e5d1e79565876b71 (diff) | |
download | mailfromd-3121834c53912f8a6bfcd4931bae9998bbb4a78d.tar.gz mailfromd-3121834c53912f8a6bfcd4931bae9998bbb4a78d.tar.bz2 |
Implement getpw.* interfaces
* mfd/bi_getpw.m4: New file.
* mfd/Makefile.am (M4_FILES): Add bi_getpw.m4
* doc/Makefile.am (check-builtins): Take into
account @deftypefnx
* NEWS, doc/mailfromd.texi: Update
-rw-r--r-- | NEWS | 23 | ||||
-rw-r--r-- | doc/Makefile.am | 2 | ||||
-rw-r--r-- | doc/mailfromd.texi | 46 | ||||
-rw-r--r-- | mfd/Makefile.am | 1 |
4 files changed, 69 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | Mailfromd NEWS -- history of user-visible changes. 2009-06-14 | 1 | Mailfromd NEWS -- history of user-visible changes. 2009-08-18 |
2 | Copyright (C) 2005, 2006, 2007, 2008, 2009 Sergey Poznyakoff | 2 | Copyright (C) 2005, 2006, 2007, 2008, 2009 Sergey Poznyakoff |
3 | See the end of file for copying conditions. | 3 | See the end of file for copying conditions. |
4 | 4 | ||
@@ -88,7 +88,26 @@ do so, its first argument must be a valid socket URL prefixed with | |||
88 | number fd open("@ inet://127.0.0.1:25") | 88 | number fd open("@ inet://127.0.0.1:25") |
89 | 89 | ||
90 | The I/O operations on `fd' will write to and read from the opened socket. | 90 | The I/O operations on `fd' will write to and read from the opened socket. |
91 | 91 | ||
92 | * System user database functions | ||
93 | |||
94 | These functions provide interfaces to corresponding POSIX calls: | ||
95 | |||
96 | - string getpwnam (string NAME) | ||
97 | - string getpwuid (number UID) | ||
98 | |||
99 | The return value is the string in the usual /etc/passwd format. | ||
100 | If argument is not found in the system password database, these | ||
101 | functions raise the e_not_found exception. | ||
102 | |||
103 | In addition, the following two functions are provided for checking | ||
104 | whether the given key is present in the system password database: | ||
105 | |||
106 | - boolean mappwnam (string NAME) | ||
107 | - boolean mappwuid (number UID) | ||
108 | |||
109 | These functions never raise exceptions. | ||
110 | |||
92 | * New I/O functions | 111 | * New I/O functions |
93 | 112 | ||
94 | - string read (number RD, number N) | 113 | - string read (number RD, number N) |
diff --git a/doc/Makefile.am b/doc/Makefile.am index 1a7396c4..499c2181 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am | |||
@@ -65,7 +65,7 @@ check-builtins: | |||
65 | '/MF_DEFUN/{s/[ \t]*MF_DEFUN *(\([a-zA-Z_][a-zA-Z0-9_]*\),.*/\1/p;\ | 65 | '/MF_DEFUN/{s/[ \t]*MF_DEFUN *(\([a-zA-Z_][a-zA-Z0-9_]*\),.*/\1/p;\ |
66 | s/[ \t]*MF_DEFUN_VARARGS\(_NO_PROM\)\? *(\([a-zA-Z_][a-zA-Z0-9_]*\),.*/\2/p;\ | 66 | s/[ \t]*MF_DEFUN_VARARGS\(_NO_PROM\)\? *(\([a-zA-Z_][a-zA-Z0-9_]*\),.*/\2/p;\ |
67 | s/[ \t]*MF_DEFUN_CTYPE *(\([a-zA-Z_][a-zA-Z0-9_]*\))/\1/p}'\ | 67 | s/[ \t]*MF_DEFUN_CTYPE *(\([a-zA-Z_][a-zA-Z0-9_]*\))/\1/p}'\ |
68 | 's/@deftypefn {Built-in Function} *[^ ][^ ]* *\([^ ]*\).*/\1/p' \ | 68 | 's/@deftypefnx\{0,1\} {Built-in Function} *[^ ][^ ]* *\([^ ]*\).*/\1/p' \ |
69 | $(top_srcdir)/mfd/bi_*.m4 -- \ | 69 | $(top_srcdir)/mfd/bi_*.m4 -- \ |
70 | $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \ | 70 | $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \ |
71 | $(info_TEXINFOS) | 71 | $(info_TEXINFOS) |
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 86f4d845..60af5b07 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi | |||
@@ -243,6 +243,7 @@ Built-in and Library Functions | |||
243 | * Database functions:: | 243 | * Database functions:: |
244 | * I/O functions:: | 244 | * I/O functions:: |
245 | * System functions:: | 245 | * System functions:: |
246 | * Passwd functions:: | ||
246 | * Sieve Interface:: | 247 | * Sieve Interface:: |
247 | * Interfaces to Third-Party Programs:: | 248 | * Interfaces to Third-Party Programs:: |
248 | * Rate limiting functions:: | 249 | * Rate limiting functions:: |
@@ -5886,6 +5887,7 @@ in version @value{VERSION}. | |||
5886 | * Database functions:: | 5887 | * Database functions:: |
5887 | * I/O functions:: | 5888 | * I/O functions:: |
5888 | * System functions:: | 5889 | * System functions:: |
5890 | * Passwd functions:: | ||
5889 | * Sieve Interface:: | 5891 | * Sieve Interface:: |
5890 | * Interfaces to Third-Party Programs:: | 5892 | * Interfaces to Third-Party Programs:: |
5891 | * Rate limiting functions:: | 5893 | * Rate limiting functions:: |
@@ -8022,6 +8024,50 @@ Set the umask to @var{mask} & 0777. Return the previous value of the | |||
8022 | mask. | 8024 | mask. |
8023 | @end deftypefn | 8025 | @end deftypefn |
8024 | 8026 | ||
8027 | @node Passwd functions | ||
8028 | @subsubsection System User Database | ||
8029 | |||
8030 | @deftypefn {Built-in Function} string getpwnam (string @var{name}) | ||
8031 | @deftypefnx {Built-in Function} string getpwuid (number @var{uid}) | ||
8032 | Look for the user @var{name} (@code{getpwnam}) or user ID @var{uid} | ||
8033 | (@code{getpwuid}) in the system password database and return the | ||
8034 | corresponding record, if found. If not found, raise the | ||
8035 | @samp{e_not_found} exception. | ||
8036 | |||
8037 | The returned record consists of six fields, separated by colon sign: | ||
8038 | |||
8039 | @smallexample | ||
8040 | uname:passwd:uid:gid:gecos:dir:shell | ||
8041 | @end smallexample | ||
8042 | |||
8043 | @multitable @columnfractions 0.3 0.6 | ||
8044 | @headitem Field @tab Meaning | ||
8045 | @item uname @tab user name | ||
8046 | @item passwd @tab user password | ||
8047 | @item uid @tab user ID | ||
8048 | @item gid @tab group ID | ||
8049 | @item gecos @tab real name | ||
8050 | @item dir @tab home directory | ||
8051 | @item shell @tab shell program | ||
8052 | @end multitable | ||
8053 | |||
8054 | For example: | ||
8055 | |||
8056 | @smallexample | ||
8057 | getpwnam("gray") | ||
8058 | @result{} "gray:x:1000:1000:Sergey Poznyakoff:/home/gray:/bin/bash" | ||
8059 | @end smallexample | ||
8060 | @end deftypefn | ||
8061 | |||
8062 | Following two functions can be used to test for existence of a key in | ||
8063 | the user database: | ||
8064 | |||
8065 | @deftypefn {Built-in Function} boolean mappwnam (string @var{name}) | ||
8066 | @deftypefnx {Built-in Function} boolean mappwuid (number @var{uid}) | ||
8067 | Return @samp{true} if @var{name} (or @var{uid}) is found in the system | ||
8068 | user database. | ||
8069 | @end deftypefn | ||
8070 | |||
8025 | @node Sieve Interface | 8071 | @node Sieve Interface |
8026 | @subsubsection Sieve Interface | 8072 | @subsubsection Sieve Interface |
8027 | @cindex Sieve | 8073 | @cindex Sieve |
diff --git a/mfd/Makefile.am b/mfd/Makefile.am index cf5637c3..962dc589 100644 --- a/mfd/Makefile.am +++ b/mfd/Makefile.am | |||
@@ -28,6 +28,7 @@ M4_FILES=\ | |||
28 | bi_geoip.m4\ | 28 | bi_geoip.m4\ |
29 | bi_gethostname.m4\ | 29 | bi_gethostname.m4\ |
30 | bi_getopt.m4\ | 30 | bi_getopt.m4\ |
31 | bi_getpw.m4\ | ||
31 | bi_gettext.m4\ | 32 | bi_gettext.m4\ |
32 | bi_header.m4\ | 33 | bi_header.m4\ |
33 | bi_io.m4\ | 34 | bi_io.m4\ |