Lines Matching +full:ps +full:- +full:seq +full:- +full:id
2 * Copyright (c) 1998-2013 Proofpoint, Inc. and its suppliers.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
16 SM_RCSID("@(#)$Id: conf.c,v 8.1192 2014-01-27 18:23:21 ca Exp $")
64 ** CONF.C -- Sendmail Configuration Tables.
69 ** HdrInfo -- a table describing well-known header fields.
78 ** are running, or is really static -- for example
103 { "resent-sender", H_FROM|H_RESENT, NULL },
104 { "resent-from", H_FROM|H_RESENT, NULL },
105 { "resent-reply-to", H_FROM|H_RESENT, NULL },
108 { "reply-to", H_FROM | Xflags, NULL },
109 { "errors-to", H_FROM|H_ERRORSTO, NULL },
110 { "full-name", H_ACHECK, NULL },
111 { "return-receipt-to", H_RECEIPTTO, NULL },
112 { "delivery-receipt-to", H_RECEIPTTO, NULL },
113 { "disposition-notification-to", H_FROM, NULL },
117 { "resent-to", H_RCPT|H_RESENT, NULL },
119 { "resent-cc", H_RCPT|H_RESENT, NULL },
121 { "resent-bcc", H_RCPT|H_BCC|H_RESENT, NULL },
122 { "apparently-to", H_RCPT, NULL },
125 { "message-id", 0, NULL },
126 { "resent-message-id", H_RESENT, NULL },
134 { "resent-date", H_RESENT, NULL },
138 { "x400-received", H_TRACE|H_FORCE, NULL },
140 { "mail-from", H_TRACE|H_FORCE, NULL },
144 { "return-path", H_FORCE|H_ACHECK|H_BINDLATE, NULL },
145 { "content-transfer-encoding", H_CTE, NULL },
146 { "content-type", H_CTYPE, NULL },
147 { "content-length", H_ACHECK, NULL },
149 { "x-authentication-warning", H_FORCE, NULL },
254 ** SETDEFAULTS -- set default values
257 ** depend on run-time values. So let's do all of them this way.
260 ** e -- the default envelope.
300 if (((pw = sm_getpwnam("mailnull")) != NULL && pw->pw_uid != 0) ||
301 ((pw = sm_getpwnam("sendmail")) != NULL && pw->pw_uid != 0) ||
302 ((pw = sm_getpwnam("daemon")) != NULL && pw->pw_uid != 0))
304 DefUid = pw->pw_uid; /* option u */
305 DefGid = pw->pw_gid; /* option g */
306 DefUser = newstr(pw->pw_name);
322 e->e_errormode = EM_PRINT; /* option e */
323 e->e_qgrp = NOQGRP;
324 e->e_qdir = NOQDIR;
325 e->e_xfqgrp = NOQGRP;
326 e->e_xfqdir = NOQDIR;
327 e->e_ctime = curtime();
329 e->e_smtputf8 = false;
336 MilterLogLevel = -1;
446 ** SETDEFUSER -- set/reset DefUser using DefUid (for initgroups())
458 (defpwent == NULL || defpwent->pw_name == NULL) in setdefuser()
459 ? "nobody" : defpwent->pw_name, in setdefuser()
466 ** SETUPQUEUES -- initialize default queues
483 ** SETUPMAILERS -- initialize default mailers
491 (void) sm_strlcpy(buf, "prog, P=/bin/sh, F=lsouDq9, T=X-Unix/X-Unix/X-Unix, A=sh -c \201u", in setupmailers()
495 (void) sm_strlcpy(buf, "*file*, P=[FILE], F=lsDFMPEouq9, T=X-Unix/X-Unix/X-Unix, A=FILE \201u", in setupmailers()
505 ** SETUPMAPS -- set up map classes
516 s->s_mapclass.map_cname = name; \
517 s->s_mapclass.map_ext = ext; \
518 s->s_mapclass.map_cflags = flags; \
519 s->s_mapclass.map_parse = parse; \
520 s->s_mapclass.map_open = open; \
521 s->s_mapclass.map_close = close; \
522 s->s_mapclass.map_lookup = lookup; \
523 s->s_mapclass.map_store = store; \
539 …syserr("Berkeley DB version mismatch: compiled against %d.%d.%d, run-time linked against %d.%d.%d", in setupmaps()
690 /* null map lookup -- really for internal use only */ in setupmaps()
695 /* syslog map -- logs information to syslog */ in setupmaps()
700 /* macro storage map -- rulesets can set macros */ in setupmaps()
705 /* arithmetic map -- add/subtract/compare */ in setupmaps()
710 /* "arpa" map -- IP -> arpa */ in setupmaps()
723 /* dprintf map -- logs information to syslog */ in setupmaps()
730 /* setdebug map -- set debug levels */ in setupmaps()
737 /* setopt map -- set option */ in setupmaps()
745 /* bogus map -- always return tempfail */ in setupmaps()
754 ** INITHOSTMAPS -- initial host-dependent maps
792 (void) sm_strlcat(buf, " -a. -D", sizeof(buf)); in inithostmaps()
823 (void) sm_strlcpy(buf, "aliases.nisplus nisplus -kalias -vexpansion mail_aliases.org_dir", in inithostmaps()
841 (void) sm_strlcpy(buf, "aliases.netinfo netinfo -z, /aliases", in inithostmaps()
860 (void) sm_strlcpy(buf, "aliases.ldap ldap -b . -h localhost -k mail=%0 -v mailgroup", in inithostmaps()
874 ** SWITCH_MAP_FIND -- find the list of types associated with a map
876 ** This is the system-dependent interface to the service switch.
879 ** service -- the name of the service of interest.
880 ** maptype -- an out-array of strings containing the types
883 ** mapreturn -- an out-array of return information bitmaps
887 ** The number of map types filled in, or -1 for failure.
939 lk = nsw_conf->lookups;
943 maptype[svcno] = lk->service_name;
944 if (lk->actions[__NSW_NOTFOUND] == __NSW_RETURN)
946 if (lk->actions[__NSW_TRYAGAIN] == __NSW_RETURN)
948 if (lk->actions[__NSW_UNAVAIL] == __NSW_RETURN)
951 lk = lk->next;
976 return -1;
980 switch (svcinfo->svcpath[svc][svcno])
1011 ** Fall-back mechanism.
1021 if ((now - servicecachetime) > (time_t) ServiceCacheMaxAge)
1076 if (st->s_service[0] != NULL)
1077 sm_free((void *) st->s_service[0]); /* XXX */
1083 st->s_service[svcno++] = p;
1092 st->s_service[svcno] = NULL;
1100 if (st != NULL && st->s_service[0] != NULL)
1106 maptype[svcno] = st->s_service[svcno];
1111 return --svcno;
1170 return -1;
1174 ** USERNAME -- return the user id of the logged in user.
1204 myname = pw->pw_name; in username()
1211 (uid != 0 && uid != pw->pw_uid)) in username()
1215 myname = pw->pw_name; in username()
1231 ** TTYPATH -- Get the path of the user's tty
1285 ** CHECKCOMPAT -- check for From and To person compatible.
1287 ** This routine can be supplied on a per-installation basis
1294 ** should be returned. You can also set to->q_status to
1295 ** a DSN-style status code.
1297 ** EF_NO_BODY_RETN can be set in e->e_flags to suppress the
1298 ** body during the return-to-sender function; this should be done
1303 ** to -- the person being sent to.
1319 to->q_paddr, e->e_from.q_paddr);
1326 if (s != NULL && strcmp(e->e_from.q_mailer->m_name, "local") != 0 &&
1327 to->q_mailer == s->s_mailer)
1330 /* e->e_flags |= EF_NO_BODY_RETN; to suppress body on return */
1331 to->q_status = "5.7.1";
1357 ** INIT_MD -- do machine dependent initializations
1407 if (getluid() == -1)
1419 ** INIT_VENDOR_MACROS -- vendor-dependent macro initializations
1424 ** e -- the global envelope.
1430 ** vendor-dependent.
1439 ** GETLA -- get the current load average
1468 #define LA_PSET 15 /* Solaris per-processor-set load average */
1536 static int kmem = -1; in getla()
1569 return -1; in getla()
1576 return -1; in getla()
1588 return -1; in getla()
1597 kmem = -1; in getla()
1598 return -1; in getla()
1604 if (lseek(kmem, (off_t) Nl[X_AVENRUN].n_value, SEEK_SET) == -1 || in getla()
1611 return -1; in getla()
1661 static int kmem = -1; in getla()
1673 return -1; in getla()
1682 kmem = -1; in getla()
1683 return -1; in getla()
1694 return -1; in getla()
1752 (size_t) 1, 0) == -1) in getla()
1775 return -1; in getla()
1811 return -1; in getla()
1821 return -1; in getla()
1866 return -1; in _SM_CONF_BROKEN_STRTOD()
1875 return -1; in _SM_CONF_BROKEN_STRTOD()
1900 static int kmem = -1; in getla()
1911 return -1; in getla()
1920 kmem = -1; in getla()
1921 return -1; in getla()
1926 == -1 || in getla()
1932 return -1; in getla()
1970 return -1; in getla()
1979 return -1; in getla()
1986 return -1; in getla()
1989 la = ((double) ksn->value.ul + FSCALE/2) / FSCALE; in getla()
2013 static int afd = -1; in getla()
2020 if (afd == -1 || lseek(afd, 0L, SEEK_SET) == -1) in getla()
2023 return -1; in getla()
2030 return -1; in getla()
2039 r == -1 ? sm_errstring(errno) : "short read"); in getla()
2040 return -1; in getla()
2064 if (table(TBL_LOADAVG, 0, &tab, 1, sizeof(tab)) == -1) in getla()
2068 return -1; in getla()
2101 return -1; in getla()
2169 ** SM_GETLA -- get the current load average
2192 ** SHOULDQUEUE -- should this message be queued or sent?
2200 ** pri -- the priority of the message in question.
2201 ** ct -- the message creation time (unused, but see above).
2204 ** true -- if this message should be queued up for the
2206 ** false -- if the load is low enough to send this message.
2244 rval = pri > (QueueFactor / (CurrentLA - QueueLA + 1));
2251 ** REFUSECONNECTIONS -- decide if connections should be refused
2254 ** e -- the current envelope.
2255 ** dn -- number of daemon.
2256 ** active -- was this daemon actually active?
2355 pintvl(now - firstrejtime[dn], true));
2406 ** SETPROCTITLE -- set process title for ps
2409 ** fmt -- a printf style format string.
2410 ** a, b, c -- possible parameters to fmt.
2416 ** Clobbers argv of our main procedure so ps(1) will
2424 #define SPT_PSSTRINGS 4 /* use PS_STRINGS->... */
2425 #define SPT_SYSMIPS 5 /* use sysmips() supported by NEWS-OS 6 */
2494 # define SPT_ALIGN(x, align) (((((x) + SPT_ALIGN_SIZE) >> (align)) << (align)) - 1)
2504 ** This allows "ps" listings to give more useful information.
2552 align = -1;
2594 static int kmem = -1;
2595 static pid_t kmempid = -1;
2619 PS_STRINGS->ps_nargvstr = 1;
2620 PS_STRINGS->ps_argvstr = buf;
2637 kmem = -1;
2642 buf[PSARGSZ - 1] = '\0';
2643 seek_off = UVUBLK + (off_t) u.u_psargs - (off_t) &u;
2651 if (i > LastArgv - Argv[0] - 2)
2653 i = LastArgv - Argv[0] - 2;
2671 ** SM_SETPROCTITLE -- set process task and set process title for ps
2674 ** change the ps display.
2677 ** status -- whether or not to store as process status
2678 ** e -- the current envelope.
2679 ** fmt -- a printf style format string.
2680 ** a, b, c -- possible parameters to fmt.
2720 ** WAITFOR -- wait for a particular process id.
2723 ** pid -- process id to wait for.
2727 ** -1 if pid never shows up.
2748 return -1;
2752 ** SM_WAIT -- wait
2755 ** status -- pointer to status (return value)
2791 ** REAPCHILD -- pick up the body of my child, lest it become a zombie
2794 ** sig -- the signal that got us here (unused).
2821 while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
2837 ** Catch one zombie -- we will be re-invoked (we hope) if there
2839 ** is the "old system" situation -- waitpid or wait3 are to be
2856 ** GETDTSIZE -- return number of file descriptors
2858 ** Only on non-BSD systems
2895 ** UNAME -- get the UUCP name of this system.
2907 name->nodename[0] = '\0';
2909 /* try /etc/whoami -- one line with the node name */
2913 (void) sm_io_fgets(file, SM_TIME_DEFAULT, name->nodename,
2916 n = strchr(name->nodename, '\n');
2919 if (name->nodename[0] != '\0')
2923 /* try /usr/include/whoami.h -- has a #define somewhere */
2934 NODE_LENGTH, name->nodename) > 0)
2938 if (name->nodename[0] != '\0')
2942 return -1;
2946 ** INITGROUPS -- initialize groups
2962 ** SETGROUPS -- set group list
2978 ** SETSID -- set session id (for non-POSIX systems)
3005 ** FSYNC -- dummy fsync
3023 ** DGUX_INET_ADDR -- inet_addr for DG/UX
3046 ** GETOPT -- for old systems or systems with bogus implementations
3103 if (optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) {
3105 return -1;
3107 if (*place == '-') { /* found "--" */
3110 return -1;
3115 tell(": illegal option -- ");
3125 tell(": option requires an argument -- ");
3136 ** USERSHELLOK -- tell if a user's shell is ok for unrestricted use
3139 ** user -- the name of the user we are checking.
3140 ** shell -- the user's shell from /etc/passwd
3143 ** true -- if it is ok to use this for unrestricted access.
3144 ** false -- if the shell is restricted.
3262 ** considered part of the security library (-ls), and it
3327 ** FREEDISKSPACE -- see how much free space is on the queue filesystem
3332 ** dir -- the directory in question.
3333 ** bsize -- a variable into which the filesystem
3338 ** -1 if the statfs call fails.
3347 #define SFS_4ARGS 2 /* use four-argument statfs call */
3436 return -1;
3440 ** ENOUGHDISKSPACE -- is there enough free space on the queue file systems?
3443 ** msize -- the size to check against. If zero, we don't yet
3446 ** e -- envelope, or NULL -- controls logging
3485 ** TRANSIENTERROR -- tell if an error code indicates a transient failure
3491 ** err -- the errno code to classify.
3590 ** LOCKFILE -- lock a file using flock or (shudder) fcntl locking
3593 ** fd -- the file descriptor of the file.
3594 ** filename -- the file name (for error messages).
3595 ** ext -- the filename extension.
3596 ** type -- type of the lock. Bits can be:
3597 ** LOCK_EX -- exclusive lock.
3598 ** LOCK_NB -- non-blocking.
3599 ** LOCK_UN -- unlock.
3655 ** On SunOS, if you are testing using -oQ/tmp/mqueue or
3656 ** -oA/tmp/aliases or anything like that, and /tmp is mounted
3720 ** CHOWNSAFE -- tell if chown is "safe" (executable only by root)
3726 ** Note also that many operating systems have non-compliant
3728 ** fpathconf() routine. According to IEEE 1003.1-1990, if
3729 ** _POSIX_CHOWN_RESTRICTED is defined and not equal to -1, then
3730 ** no non-root process can give away the file. However, vendors
3736 ** this wrong on NFS-based filesystems (that is, they say that chown
3740 ** get the value of SAFENFSPATHCONF correct -- it should be defined
3742 ** NFS-based filesystem to ensure that you can get meaningful results.
3745 ** You may also need to tweak IS_SAFE_CHOWN -- it should be a
3747 ** that chown is safe (typically either > 0 or >= 0 -- there isn't
3753 ** in more circumstances. This is really a crock -- if this is an
3760 ** (have :include: files in group- or world-writable directories).
3763 ** fd -- the file descriptor to check.
3764 ** safedir -- set if the parent directory is safe.
3767 ** true -- if the chown(2) operation is "safe" -- that is,
3769 ** false -- if an arbitrary user can give away a file.
3781 #if (!defined(_POSIX_CHOWN_RESTRICTED) || _POSIX_CHOWN_RESTRICTED != -1) && \
3802 #else /* (!defined(_POSIX_CHOWN_RESTRICTED) || _POSIX_CHOWN_RESTRICTED != -1) && ... */
3804 #endif /* (!defined(_POSIX_CHOWN_RESTRICTED) || _POSIX_CHOWN_RESTRICTED != -1) && ... */
3807 ** RESETLIMITS -- reset system controlled resource limits
3809 ** This is to avoid denial-of-service attacks
3847 ** SETVENDOR -- process vendor code from V configuration line
3850 ** vendor -- string representation of vendor.
3853 ** true -- if ok.
3854 ** false -- if vendor code could not be processed.
3901 ** GETVENDOR -- return vendor name based on vendor code
3904 ** vendorcode -- numeric representation of vendor.
3947 ** VENDOR_PRE_DEFAULTS, VENDOR_POST_DEFAULTS -- set vendor-specific defaults
3953 ** e -- the global environment to initialize.
3960 int DefShareUid; /* default share uid to run as -- unused??? */
3998 ** VENDOR_DAEMON_SETUP -- special vendor setup needed for daemon mode
4009 if (getluid() != -1)
4017 ** VENDOR_SET_UID -- do setup for setting a user id
4022 ** uid -- the uid we are about to become.
4046 ** VALIDATE_CONNECTION -- check connection for rationality
4049 ** appropriate message -- but should never issue any SMTP protocol.
4052 ** sap -- a pointer to a SOCKADDR naming the peer.
4053 ** hostname -- the name corresponding to sap.
4054 ** e -- the current envelope.
4064 /* tcpwrappers does no logging, but you still have to declare these -- ugh */
4104 if (hostname[0] == '[' && hostname[strlen(hostname) - 1] == ']')
4121 sm_syslog(LOG_NOTICE, e->e_id,
4133 ** STRTOL -- convert string to long integer
4137 ** This is taken verbatim from the 4.4-Lite C library.
4166 ** Skip white space and pick up leading +/- sign if any.
4173 if (c == '-') {
4195 ** [-2147483648..2147483647] and the input base is 10,
4204 cutoff = neg ? -(unsigned long) LONG_MIN : LONG_MAX;
4209 c -= '0';
4211 c -= isupper(c) ? 'A' - 10 : 'a' - 10;
4217 any = -1;
4228 acc = -acc;
4230 *endptr = (char *)(any ? s - 1 : nptr);
4236 ** STRSTR -- find first substring in string
4239 ** big -- the big (full) string.
4240 ** little -- the little (sub) string.
4273 ** SM_GETHOSTBY{NAME,ADDR} -- compatibility routines for gethostbyXXX
4332 if (h != NULL && h->h_addrtype != family)
4366 ** Stub routine -- if they don't have getipnodeby*(),
4403 /* For IPv4-mapped addresses, use: AI_DEFAULT|AI_ALL */
4438 while (--nmaps >= 0)
4448 if (strlen(name) > sizeof(hbuf) - 1)
4477 if (h != NULL && h->h_addrtype != family)
4493 sm_dprintf("%s\n", h->h_name);
4503 if (h->h_aliases != NULL)
4504 for (i = 0; h->h_aliases[i] != NULL;
4507 h->h_aliases[i]);
4508 for (i = 0; h->h_addr_list[i] != NULL; i++)
4514 if (h->h_addrtype == AF_INET6)
4516 memmove(&ia6, h->h_addr_list[i],
4525 memmove(&ia, h->h_addr_list[i],
4589 ** SM_GETPW{NAM,UID} -- wrapper for getpwnam and getpwuid
4618 ** SECUREWARE_SETUP_SECURE -- Convex SecureWare setup
4624 ** uid -- uid of the user to initialize in the TCB
4644 if (getluid() != -1)
4684 ** ADD_HOSTNAMES -- Add a hostname to class 'w' based on IP address
4690 ** sa -- a pointer to a SOCKADDR containing the address
4693 ** 0 if successful, -1 if host lookup fails.
4705 switch (sa->sa.sa_family)
4709 hp = sm_gethostbyaddr((char *) &sa->sin.sin_addr,
4710 sizeof(sa->sin.sin_addr),
4711 sa->sa.sa_family);
4717 hp = sm_gethostbyaddr((char *) &sa->sin6.sin6_addr,
4718 sizeof(sa->sin6.sin6_addr),
4719 sa->sa.sa_family);
4728 sa->sa.sa_family, anynet_ntoa(sa));
4729 return -1;
4738 !(sa->sa.sa_family == AF_INET &&
4739 IN_LINKLOCAL(ntohl(sa->sin.sin_addr.s_addr))) &&
4742 !(sa->sa.sa_family == AF_INET6 &&
4743 IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr)) &&
4752 -1
4756 return -1;
4760 if (!wordinclass((char *) hp->h_name, 'w'))
4762 setclass('w', (char *) hp->h_name);
4764 sm_dprintf("\ta.k.a.: %s\n", hp->h_name);
4766 if (sm_snprintf(hnb, sizeof(hnb), "[%s]", hp->h_name) <
4774 sm_dprintf("\ta.k.a.: %s (already in $=w)\n", hp->h_name);
4778 for (ha = hp->h_aliases; ha != NULL && *ha != NULL; ha++)
4803 ** LOAD_IF_NAMES -- load interface-specific names into $=w
4864 if (s == -1) in load_if_names()
4881 /* can't get number of interfaces -- fall back */ in load_if_names()
4885 numifs = -1; in load_if_names()
4924 SOCKADDR *sa = (SOCKADDR *) &ifr->lifr_addr; in load_if_names()
4925 int af = ifr->lifr_addr.ss_family; in load_if_names()
4945 if (s == -1) in load_if_names()
4956 if ((len - i) < sizeof(*ifr)) in load_if_names()
4960 if (sa->sa.sa_len > sizeof(ifr->lifr_addr)) in load_if_names()
4961 i += sizeof(ifr->lifr_name) + sa->sa.sa_len; in load_if_names()
4968 i += sizeof(ifr->ifr_name) + in load_if_names()
4969 max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len); in load_if_names()
4983 (void) sm_strlcpy(ifrf.lifr_name, ifr->lifr_name, in load_if_names()
4993 name = ifr->lifr_name; in load_if_names()
5012 if ((IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr) || in load_if_names()
5013 IN6_IS_ADDR_SITELOCAL(&sa->sin6.sin6_addr)) && in load_if_names()
5014 sa->sin6.sin6_scope_id == 0) in load_if_names()
5018 ia6p = &sa->sin6.sin6_addr; in load_if_names()
5019 sa->sin6.sin6_scope_id = ntohs(ia6p->s6_addr[3] | in load_if_names()
5020 ((unsigned int)ia6p->s6_addr[2] << 8)); in load_if_names()
5021 ia6p->s6_addr[2] = ia6p->s6_addr[3] = 0; in load_if_names()
5024 ia6 = sa->sin6.sin6_addr; in load_if_names()
5038 (int) sizeof(ip_addr) - 3, in load_if_names()
5043 ia = sa->sin.sin_addr; in load_if_names()
5054 (int) sizeof(ip_addr) - 3, inet_ntoa(ia)); in load_if_names()
5086 if (s == -1) in load_if_names()
5093 /* can't get number of interfaces -- fall back */ in load_if_names()
5097 numifs = -1; in load_if_names()
5134 SOCKADDR *sa = (SOCKADDR *) &ifr->ifr_addr; in load_if_names()
5153 if ((ifc.ifc_len - i) < sizeof(*ifr)) in load_if_names()
5157 if (sa->sa.sa_len > sizeof(ifr->ifr_addr)) in load_if_names()
5158 i += sizeof(ifr->ifr_name) + sa->sa.sa_len; in load_if_names()
5169 af = ifr->ifr_addr.sa_family; in load_if_names()
5179 (void) sm_strlcpy(ifrf.ifr_name, ifr->ifr_name, in load_if_names()
5199 ia = sa->sin.sin_addr; in load_if_names()
5204 ifr->ifr_name, inet_ntoa(ia)); in load_if_names()
5210 (int) sizeof(ip_addr) - 3, in load_if_names()
5219 if ((IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr) || in load_if_names()
5220 IN6_IS_ADDR_SITELOCAL(&sa->sin6.sin6_addr)) && in load_if_names()
5221 sa->sin6.sin6_scope_id == 0) in load_if_names()
5225 ia6p = &sa->sin6.sin6_addr; in load_if_names()
5226 sa->sin6.sin6_scope_id = ntohs(ia6p->s6_addr[3] | in load_if_names()
5227 ((unsigned int)ia6p->s6_addr[2] << 8)); in load_if_names()
5228 ia6p->s6_addr[2] = ia6p->s6_addr[3] = 0; in load_if_names()
5231 ia6 = sa->sin6.sin6_addr; in load_if_names()
5236 ifr->ifr_name, in load_if_names()
5246 (int) sizeof(ip_addr) - 3, in load_if_names()
5277 ** ISLOOPBACK -- is socket address in the loopback net?
5280 ** sa -- socket address.
5283 ** true -- is socket address in the loopback net?
5284 ** false -- otherwise
5317 ** GET_NUM_PROCS_ONLINE -- return the number of processors currently online
5349 if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) != -1) in get_num_procs_online()
5360 ** SM_CLOSEFROM -- close file descriptors
5363 ** lowest -- first fd to close
5364 ** highest -- last fd + 1 to close
5385 ** CLOSEFD_WALK -- walk fd's arranging to close them
5389 ** lowest -- first fd to arrange to be closed
5390 ** fd -- fd to arrange to be closed
5407 ** SM_CLOSE_ON_EXEC -- arrange for file descriptors to be closed
5410 ** lowest -- first fd to arrange to be closed
5411 ** highest -- last fd + 1 to arrange to be closed
5428 if ((j = fcntl(i, F_GETFD, 0)) != -1)
5434 ** SEED_RANDOM -- seed the random number generator
5464 ** SM_SYSLOG -- syslog wrapper to keep messages under SYSLOG_BUFSIZE
5467 ** level -- syslog level
5468 ** id -- envelope ID or NULL (NOQUEUE)
5469 ** fmt -- format string
5470 ** arg... -- arguments as implied by fmt.
5479 sm_syslog(int level, const char *id, const char *fmt, ...) in sm_syslog() argument
5481 sm_syslog(level, id, fmt, va_alist) in sm_syslog()
5483 const char *id;
5492 int seq = 1; local
5500 if (id == NULL)
5501 id = "NOQUEUE";
5502 idlen = strlen(id) + SyslogPrefixLen;
5531 /* for testing! maybe make it an -d option (hence runtime)? */
5539 if (*id == '\0')
5562 (long) tv.tv_usec, id, newstring);
5565 sm_dprintf("%s: %s\n", id, newstring);
5567 syslog(level, "%s: %s", id, newstring);
5571 if (*id == '\0')
5576 "%s: %s\n", id, newstring);
5598 if (seq >= 999)
5603 end = begin + SYSLOG_BUFSIZE - idlen - SL_SPLIT;
5612 end--;
5616 end = begin + SYSLOG_BUFSIZE - idlen - SL_SPLIT;
5621 sm_dprintf("%s[%d]: %s ...\n", id, seq++, begin);
5623 syslog(level, "%s[%d]: %s ...", id, seq++, begin);
5626 "%s[%d]: %s ...\n", id, seq++, begin);
5631 if (seq >= 999)
5636 id, seq);
5639 id, seq);
5642 "%s[%d]: log terminated, too many parts\n", id, seq);
5649 sm_dprintf("%s[%d]: %s\n", id, seq, begin);
5651 syslog(level, "%s[%d]: %s", id, seq, begin);
5654 "%s[%d]: %s\n", id, seq, begin);
5662 ** HARD_SYSLOG -- call syslog repeatedly until it works
5664 ** Needed on HP-UX, which apparently doesn't guarantee that
5698 for (i = MAXSYSLOGTRIES; --i >= 0 && syslog(pri, CAST "%s", buf) < 0; )
5727 (SM_STRCASEEQ(hostname + len_host - len_domain, _res.defdname)) &&
5728 hostname[len_host - len_domain - 1] == '.')
5729 return len_host - len_domain - 1;
5737 ** LINK -- clone a file
5747 ** source -- pathname of existing file.
5748 ** target -- pathname of link (clone) to be created.
5751 ** 0 -- success.
5752 ** -1 -- failure, see errno for details.
5762 int src = -1, dst = -1;
5798 left -= writelen;
5812 src = -1;
5815 src = -1;
5820 /* don't set dst = -1 here so we unlink the file */
5837 return -1;
5842 ** Compile-Time options
5888 /* set LDAP_OPT_NETWORK_TIMEOUT if available (-c) */
5970 ** makemap or newaliases - but there might be other things
5973 ** You have been warned - use at your own risk!
6389 /* WIP: remove entries from a class: C-{name}entry */
6478 ** EightBitAddrOK: allow all 8-bit e-mail addresses.
6512 ** If using -t, force not sending to argv recipients, even
6544 /* Use nsswitch on HP-UX */
6560 /* Local daemon mode (-bl) which only accepts loopback connections */
6667 /* do not modify headers -- does NOT (yet) work */
6695 ** given the -1 switch, would match only a single DN,
6702 ** to 8.13.4 which adds a -2 switch (for lack of a
6706 ** Jeffrey T. Eaton, Carnegie-Mellon University
6733 /* XXX: Still need to actually use qgrp->qg_sortorder */
6758 ** envelope <> can't be sent to mailing lists, only owner-
6759 ** send spam of this type to owner- of the list
6760 ** ---- to stop spam from going to mailing lists.
6770 /* try to gather multi-line replies for reply= logging */
6783 ** allow -qGqueue_group -qp to work, i.e.,
6790 /* session id (for logging): WIP, no logging yet! */
6882 ** This will need to become an OS-specific #if enabled
6890 ** Sets X509_V_FLAG_TRUSTED_FIRST if -d88;.101 is used.
6920 /* X-Connect support */
6944 /* Reverse sort for host for recipient sorting pre-envelope-split */