Back to index

courier  0.68.2
submitmkdir.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 1999 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #include      "courier.h"
00007 #include      "localstatedir.h"
00008 #include      <stdlib.h>
00009 #include      <stdio.h>
00010 #if    HAVE_SYS_TYPES_H
00011 #include      <sys/types.h>
00012 #endif
00013 #if    HAVE_SYS_STAT_H
00014 #include      <sys/stat.h>
00015 #endif
00016 #if    HAVE_UNISTD_H
00017 #include      <unistd.h>
00018 #endif
00019 
00020 int main(int argc, char **argv)
00021 {
00022        umask(007);
00023        if (chdir(courierdir()) == 0 && chdir(TMPDIR) == 0 && argc > 1)
00024        {
00025        const char *p=argv[1];
00026 
00027               for ( ; *p; p++)
00028                      if (*p < '0' || *p > '9')   exit(0);
00029               mkdir(argv[1], 0770);
00030        }
00031        exit(0);
00032 }