diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-08-04 02:18:02 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-08-04 02:18:02 +0000 |
commit | da20850ed158215d6b400bee5ec4c23c630a98f4 (patch) | |
tree | ce7af19af10d9a6b98426070eb40da4a4a199a8c /usr.sbin/sendmail/makemap | |
parent | 52b50bd537975831ed3de79b17a85d041aa91dc1 (diff) |
sendmail 8.8.7.
Diffstat (limited to 'usr.sbin/sendmail/makemap')
-rw-r--r-- | usr.sbin/sendmail/makemap/makemap.8 | 4 | ||||
-rw-r--r-- | usr.sbin/sendmail/makemap/makemap.c | 27 |
2 files changed, 18 insertions, 13 deletions
diff --git a/usr.sbin/sendmail/makemap/makemap.8 b/usr.sbin/sendmail/makemap/makemap.8 index 23ac522a568..3c1f6fad260 100644 --- a/usr.sbin/sendmail/makemap/makemap.8 +++ b/usr.sbin/sendmail/makemap/makemap.8 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)makemap.8 8.3 (Berkeley) 7/24/94 +.\" @(#)makemap.8 8.4 (Berkeley) 7/23/97 .\" .Dd November 16, 1992 .Dt MAKEMAP 8 @@ -89,7 +89,7 @@ the second is the value. The value may contain ``%\fIn\fP'' strings to indicated parameter substitution. -Literal parentheses should be doubled +Literal percents should be doubled (``%%''). Blank lines and lines beginning with ``#'' are ignored. .Ss Flags diff --git a/usr.sbin/sendmail/makemap/makemap.c b/usr.sbin/sendmail/makemap/makemap.c index ffe35efe1d1..e4dff21343f 100644 --- a/usr.sbin/sendmail/makemap/makemap.c +++ b/usr.sbin/sendmail/makemap/makemap.c @@ -33,7 +33,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)makemap.c 8.35 (Berkeley) 6/10/97"; +static char sccsid[] = "@(#)makemap.c 8.37 (Berkeley) 7/10/97"; #endif /* not lint */ #include <sys/types.h> @@ -137,7 +137,7 @@ main(argc, argv) RunAsUid = RealUid = getuid(); RunAsGid = RealGid = getgid(); pw = getpwuid(RealUid); - if (pw != NULL) + if (pw != NULL) { if (strlen(pw->pw_name) > MAXNAME - 1) pw->pw_name[MAXNAME] = 0; @@ -314,7 +314,7 @@ main(argc, argv) if (!notrunc) sff |= SFF_CREAT; - switch (type) + switch (type) { #ifdef NEWDB case T_BTREE: @@ -328,7 +328,7 @@ main(argc, argv) strcpy(dbuf, mapname); if (!ignoresafeties && (st = safefile(dbuf, RealUid, RealGid, RealUserName, - sff, S_IWUSR, &std)) != 0) + sff, S_IWUSR, &std)) != 0) { fprintf(stderr, "%s: could not create: %s\n", @@ -346,9 +346,8 @@ main(argc, argv) exit(EX_USAGE); } sprintf(dbuf, "%s.dir", mapname); - if (!ignoresafeties && - (st = safefile(dbuf, RealUid, RealGid, RealUserName, - sff, S_IWUSR, &std)) != 0) + if ((st = safefile(dbuf, RealUid, RealGid, RealUserName, + sff, S_IWUSR, &std)) != 0 && !ignoresafeties) { fprintf(stderr, "%s: could not create: %s\n", @@ -356,15 +355,21 @@ main(argc, argv) exit(EX_CANTCREAT); } sprintf(pbuf, "%s.pag", mapname); - if (!ignoresafeties && - (st = safefile(pbuf, RealUid, RealGid, RealUserName, - sff, S_IWUSR, &stp)) != 0) + if ((st = safefile(pbuf, RealUid, RealGid, RealUserName, + sff, S_IWUSR, &stp)) != 0 && !ignoresafeties) { fprintf(stderr, "%s: could not create: %s\n", pbuf, errstring(st)); exit(EX_CANTCREAT); } + if (std.st_dev == stp.st_dev && std.st_ino == stp.st_ino) + { + fprintf(stderr, + "%s: cannot run with GDBM\n", + mapname); + exit(EX_CONFIG); + } break; #endif default: @@ -765,7 +770,7 @@ errstring(err) #if HASSTRERROR return strerror(err); #else - if (err < 0 || err > sys_nerr) + if (err < 0 || err > sys_nerr) { sprintf(errstr, "Error %d", err); return errstr; |