extensions.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/****************************************************************************
Copyright (c) 1999,2000 WU-FTPD Development Group.
All rights reserved.
Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994
The Regents of the University of California.
Portions Copyright (c) 1993, 1994 Washington University in Saint Louis.
Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc.
Portions Copyright (c) 1989 Massachusetts Institute of Technology.
Portions Copyright (c) 1998 Sendmail, Inc.
Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P. Allman.
Portions Copyright (c) 1997 by Stan Barber.
Portions Copyright (c) 1997 by Kent Landfield.
Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997
Free Software Foundation, Inc.
Use and distribution of this software and its source code are governed
by the terms and conditions of the WU-FTPD Software License ("LICENSE").
If you did not receive a copy of the license, it may be obtained online
$Id: extensions.c,v 1.48 2000/07/01 18:17:38 wuftpd Exp $
****************************************************************************/
#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#ifdef HAVE_SYS_SYSLOG_H
#endif
#include <syslog.h>
#endif
#ifdef TIME_WITH_SYS_TIME
#include <time.h>
#else
#ifdef HAVE_SYS_TIME_H
#else
#include <time.h>
#endif
#endif
#include <pwd.h>
#include <setjmp.h>
#include <grp.h>
#ifdef HAVE_SYS_FS_UFS_QUOTA_H
#elif defined(HAVE_UFS_UFS_QUOTA_H)
#elif defined(HAVE_UFS_QUOTA_H)
#elif defined(HAVE_SYS_MNTENT_H)
#elif defined(HAVE_SYS_MNTTAB_H)
#endif
#if defined(HAVE_STATVFS)
#elif defined(HAVE_SYS_VFS)
#elif defined(HAVE_SYS_MOUNT)
#endif
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
#include "pathnames.h"
#include "extensions.h"
#include "wu_fnmatch.h"
#include "proto.h"
#if defined(HAVE_FTW)
#include <ftw.h>
#else
#endif
#ifdef QUOTA
#endif
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
#include <libgen.h>
#endif
extern char chroot_path[], guestpw[];
#ifdef TRANSFER_COUNT
extern off_t data_count_in;
extern off_t data_count_out;
#ifdef TRANSFER_LIMIT
extern off_t data_limit_raw_in;
extern off_t data_limit_raw_out;
extern off_t data_limit_raw_total;
extern off_t data_limit_data_in;
extern off_t data_limit_data_out;
extern off_t data_limit_data_total;
#ifdef RATIO /* 1998/08/06 K.Wakui */
extern time_t login_time;
extern time_t limit_time;
extern off_t total_free_dl;
extern int upload_download_rate;
#endif /* RATIO */
#endif
#endif
#ifdef OTHER_PASSWD
#include "getpwnam.h"
extern char _path_passwd[];
#endif
#ifdef LOG_FAILED
extern char the_user[];
#endif
extern char *globerr, remotehost[];
#ifdef THROUGHPUT
extern char remoteaddr[];
#endif
#ifndef HAVE_REGEX
#endif
int show_fullinfo;
/* This always was a bug, because neither st_size nor time_t were required to
be compatible with int, but needs fixing properly for C9X. */
/* Some systems use one format, some another. This takes care of the garbage */
/* Do the system specific stuff only if we aren't autoconfed */
#if !defined(L_FORMAT)
#define L_FORMAT "qd"
#else
#define L_FORMAT "d"
#endif
#endif
#if !defined(T_FORMAT)
#define T_FORMAT "d"
#endif
#if !defined(PW_UID_FORMAT)
#define PW_UID_FORMAT "d"
#endif
#if !defined(GR_GID_FORMAT)
#define GR_GID_FORMAT "d"
#endif
#ifdef SITE_NEWER
{
if (show_fullinfo != 0) {
}
}
}
/* When an ABOR has been received (which sets ftwflag > 1) return a
* non-zero value which causes ftw to stop tree traversal and return.
*/
}
#endif
#if defined(HAVE_STATVFS)
long getSize(char *s)
{
return (0);
}
long getSize(char *s)
{
return (0);
}
#endif
/*************************************************************************/
/* FUNCTION : msg_massage */
/* PURPOSE : Scan a message line for magic cookies, replacing them as */
/* needed. */
/* ARGUMENTS : pointer input and output buffers */
/*************************************************************************/
{
#ifdef QUOTA
char timeleft[80];
#endif
char buffer[MAXPATHLEN];
int limit;
#ifndef LOG_FAILED
#endif
#ifdef VIRTUAL
extern int virtual_mode;
extern int virtual_ftpaccess;
extern char virtual_email[];
#endif
extern char hostname[];
extern char authuser[];
(void) acl_getclass(buffer);
if (*inptr != '%') {
outlen -= 1;
}
else {
switch (*++inptr) {
case 'E':
#ifdef VIRTUAL
else
#endif
else
*outptr = '\0';
break;
case 'N':
break;
case 'M':
if (limit == -1)
else
break;
case 'T':
if (outlen > 24)
break;
case 'F':
#else
*outptr = '\0';
#endif
break;
case 'C':
#ifdef HAVE_GETCWD
#else
#endif
break;
case 'R':
break;
case 'L':
break;
case 'U':
else
#ifdef LOG_FAILED
#else /* LOG_FAILED */
#endif /* LOG_FAILED */
break;
case 's':
if (outlen > 24)
break;
case 'd':
if (outlen > 24)
break;
case 'r':
if (outlen > 24)
break;
/* KH : cookie %u for RFC931 name */
case 'u':
if (authenticated)
else {
if (xferdone)
else
}
break;
#ifdef QUOTA
case 'B':
#ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
#else
#endif
break;
case 'b':
#ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
#else
#endif
break;
case 'Q':
#ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
#else
#endif
break;
case 'I':
#if defined(QUOTA_INODE)
#else
#endif
break;
case 'i':
#if defined(QUOTA_INODE)
#else
#endif
break;
case 'q':
#if defined(QUOTA_INODE)
#else
#endif
break;
case 'H':
#if defined(QUOTA_INODE)
#else
#endif
break;
case 'h':
#if defined(QUOTA_INODE)
#else
#endif
break;
#endif /* QUOTA */
case '%':
*outptr++ = '%';
outlen -= 1;
*outptr = '\0';
break;
#ifdef TRANSFER_COUNT
#ifdef TRANSFER_LIMIT
#ifdef RATIO
case 'x':
switch (*++inptr) {
case 'u': /* upload bytes */
break;
case 'd': /* download bytes */
break;
case 'R': /* rate 1:n */
if( upload_download_rate > 0 ) {
}
else {
}
break;
case 'c': /* credit bytes */
if( upload_download_rate > 0 ) {
}
else {
}
break;
case 'T': /* time limit (minutes) */
if( limit_time > 0 ) {
}
else {
}
break;
case 'E': /* elapsed time from loggedin (minutes) */
break;
case 'L': /* times left until force logout (minutes) */
if( limit_time > 0 ) {
}
else {
}
break;
case 'U': /* upload limit */
if( data_limit_raw_in > 0 ) {
}
else if( data_limit_data_in > 0 ) {
}
else if( data_limit_raw_total > 0 ) {
}
else if( data_limit_data_total > 0 ) {
}
else {
}
break;
case 'D': /* download limit */
if( data_limit_raw_out > 0 ) {
}
else if( data_limit_data_out > 0 ) {
}
else if( data_limit_raw_total > 0 ) {
}
else if( data_limit_data_total > 0 ) {
}
else {
}
break;
default:
break;
}
break;
#endif /* RATIO */
#endif
#endif
/* File transfer logging (xferlog) */
case 'X':
if (xferdone) { /* only if a transfer has just occurred */
switch (*++inptr) {
case 't':
break;
case 's':
break;
case 'n':
break;
case 'P': /* absolute pathname */
/* FALLTHROUGH */
case 'p': /* chroot-relative pathname */
{
char namebuf[MAXPATHLEN];
int loop;
if (*inptr == 'P')
else
}
break;
}
case 'y':
break;
case 'f':
break;
case 'd':
break;
case 'm':
break;
case 'a':
break;
case 'r':
break;
case 'c':
break;
default:
break;
}
}
else
break;
default:
*outptr++ = '%';
outlen -= 1;
if (outlen > 1) {
outlen -= 1;
}
*outptr = '\0';
break;
}
while (*outptr) {
outptr++;
outlen -= 1;
}
}
inptr++;
}
if (outlen > 0)
*outptr = '\0';
}
/*************************************************************************/
/* FUNCTION : cwd_beenhere */
/* PURPOSE : Return 1 if the user has already visited this directory */
/* via C_WD. */
/* ARGUMENTS : a power-of-two directory function code (README, MESSAGE) */
/*************************************************************************/
int cwd_beenhere(int dircode)
{
struct dirlist {
int dircode;
char dirname[1];
};
char cwd[MAXPATHLEN];
return (0);
}
return (1);
}
}
return (0);
}
/*************************************************************************/
/* FUNCTION : show_banner */
/* PURPOSE : Display a banner on the user's terminal before login */
/* ARGUMENTS : reply code to use */
/*************************************************************************/
void show_banner(int msgcode)
{
#ifdef VIRTUAL
extern int virtual_mode;
extern int virtual_ftpaccess;
extern char virtual_banner[];
if (virtual_mode && !virtual_ftpaccess) {
if (infile) {
*crptr = '\0';
}
#ifndef NO_SUCKING_NEWLINES
#endif
}
}
else {
#endif
/* banner <path> */
if (!ARG0)
continue;
if (infile) {
*crptr = '\0';
}
#ifndef NO_SUCKING_NEWLINES
#endif
}
}
#ifdef VIRTUAL
}
#endif
}
/*************************************************************************/
/* FUNCTION : show_message */
/* PURPOSE : Display a message on the user's terminal if the current */
/* conditions are right */
/* ARGUMENTS : reply code to use, LOG_IN|CMD */
/*************************************************************************/
{
return;
#ifdef HAVE_GETCWD
#else
#endif
(void) acl_getclass(class);
/* message <path> [<when> [<class>]] */
if (!ARG0)
continue;
show = 0;
if (!ARG2)
show++;
else {
show++;
}
if (!ARG2)
show++;
else {
show++;
}
if (infile) {
*crptr = '\0';
}
#ifndef NO_SUCKING_NEWLINES
#endif
}
}
}
}
/*************************************************************************/
/* FUNCTION : show_readme */
/* PURPOSE : Display a message about a README file to the user if the */
/* current conditions are right */
/* ARGUMENTS : pointer to ACL buffer, reply code, LOG_IN|C_WD */
/*************************************************************************/
{
if (cwd_beenhere(2) != 0)
return;
#ifdef HAVE_GETCWD
#else
#endif
(void) acl_getclass(class);
/* readme <path> {<when>} */
if (!ARG0)
continue;
show = 0;
if (!ARG2)
show++;
else {
show++;
}
if (!ARG2)
show++;
else {
show++;
}
if (show) {
if (!globerr) {
errno = 0;
/*
if (days == 0) {
lreply(code, " it was last modified on %.24s - Today",
ctime((time_t *)&buf.st_mtime));
} else {
*/
" it was last modified on %.24s - %d day%s ago",
/*
}
*/
}
filelist++;
}
}
if (sfilelist) {
}
}
}
}
/*************************************************************************/
/* FUNCTION : deny_badxfertype */
/* PURPOSE : If user is in ASCII transfer mode and tries to retrieve a */
/* binary file, abort transfer and display appropriate error */
/* ARGUMENTS : message code to use for denial, path of file to check for */
/* binary contents or NULL to assume binary file */
/*************************************************************************/
{
return (1);
}
/* The hooks are here to prevent transfers of actual binary files, not
* just TAR or COMPRESS mode files... */
return (0);
}
/*************************************************************************/
/* FUNCTION : is_shutdown */
/* PURPOSE : Check to see if the server is shutting down, if it is */
/* arrange for the shutdown message to be sent in the next */
/* reply to the user */
/* ARGUMENTS : whether to arrange for a shutdown message to be sent, new */
/* or existing connection */
/* RETURNS : 1 if shutting down, 0 if not */
/*************************************************************************/
{
static int valid;
static char text[2048];
return (0);
valid = 0;
return (0);
return (0);
}
valid = 1;
text[0] = '\0';
}
}
if (!valid)
return (0);
/* if last == 0, then is_shutdown() only called with quiet == 1 so far */
autospout_free = 0;
}
/* if a new connection and past deny time, tell caller to drop 'em */
return (1);
/* if past disconnect time, tell caller to drop 'em */
return (1);
/* if less than 60 seconds to disconnection, warn 'em continuously */
autospout_free = 0;
}
/* if less than 15 minutes to disconnection, warn 'em every 5 mins */
autospout_free = 0;
}
}
/* if less than 24 hours to disconnection, warn 'em every 30 mins */
autospout_free = 0;
}
}
/* if more than 24 hours to disconnection, warn 'em every 60 mins */
autospout_free = 0;
}
}
return (0);
}
#ifdef SITE_NEWER
{
/* As ftw allocates storage it needs a chance to cleanup, setting
* ftwflag prevents myoob from calling longjmp, incrementing
* ftwflag instead which causes check_newer to return non-zero
* which makes ftw return. */
ftwflag = 1;
transflag++;
#if defined(HAVE_FTW)
#else
#endif
/* don't send a reply if myoob has already replied */
if (ftwflag == 1) {
else
}
data = -1;
pdata = -1;
transflag = 0;
ftwflag = 0;
}
}
else
}
#endif
int type_match(char *typelist)
{
char *start, *p;
int len;
return (0);
while (*p != '\0' && *p != ',')
p++;
if (*p != '\0')
p++;
return (1);
return (1);
return (1);
char class[1024];
return (1);
}
}
return (0);
}
{
else
return (-2);
}
void expand_id(void)
{
char class[1024];
(void) acl_getclass(class);
char *q;
int i = 0;
int options = 1;
int classfound = 0;
int classmatched = 0;
while (options
&& (i < MAXARGS)
&& (q[0] != '\0')) {
if (strcasecmp(q, "absolute") == 0)
i++;
else if (strcasecmp(q, "relative") == 0)
i++;
i++;
classfound = 1;
classmatched = 1;
}
else if (strcmp(q, "-") == 0) {
i++;
options = 0;
}
else
options = 0;
}
if (!classfound || classmatched) {
/*
* UID
*/
if (((i + 3) < MAXARGS)
&& (q[0] != '\0')
&& (strcmp(q, "*") != 0)) {
if (q[0] == '%')
else {
if (pwent)
else
}
dologout(1);
}
}
/*
* GID
*/
if (((i + 4) < MAXARGS)
&& (q[0] != '\0')
&& (strcmp(q, "*") != 0)) {
if (q[0] == '%')
else {
if (grent)
else
endgrent();
}
dologout(1);
}
}
}
}
}
{
/* check to see if this is a valid file name... path-filter <type>
* <message_file> <allowed_charset> <disallowed> */
int j;
char *path;
#if ! defined(HAVE_REGEXEC)
char *sp;
#endif
#ifdef M_UNIX
#ifdef HAVE_REGEX
char *regp;
#endif
#endif
#ifdef HAVE_REGEXEC
int rval;
#endif
#ifdef LINUX
#endif
/*
* check *only* the basename
*/
++path;
else
/* is it in the allowed character set? */
#if defined(HAVE_REGEXEC)
#elif defined(HAVE_REGEX)
#else
#endif
return (0);
}
#if defined(HAVE_REGEXEC)
if (rval != 0) {
#elif defined(HAVE_REGEX)
#ifdef M_UNIX
#else
#endif
#else
#endif
return (0);
}
/* is it in any of the disallowed regexps */
for (j = 3; j < MAXARGS; ++j) {
/* ARGj == entry->arg[j] */
#if defined(HAVE_REGEXEC)
#elif defined(HAVE_REGEX)
#else
#endif
return (0);
}
#if defined(HAVE_REGEXEC)
if (rval == 0) {
#elif defined(HAVE_REGEX)
#ifdef M_UNIX
#else
#endif
#else
#endif
return (0);
}
}
}
}
}
return (1);
}
{
int match_value = -1;
char cwdir[MAXPATHLEN];
char *pwdir;
char abspwdir[MAXPATHLEN];
char relpwdir[MAXPATHLEN];
char path[MAXPATHLEN];
char *sp;
int stat_result = -1;
char class[1024];
extern char *home;
(void) acl_getclass(class);
*valid = 0;
/* what's our current directory? */
/* XXX We could use dynamic RAM to store this path, but I'd rather just bail
out with an error. The rest of wu is so crufy that a long path might
just blow up later */
return (-1);
}
if (sp)
*sp = '\0';
else
return (-1);
}
return (-1);
}
return (-1);
}
char *q;
int i = 0;
int options = 1;
int classfound = 0;
int classmatched = 0;
while (options
&& (i < MAXARGS)
&& (q[0] != '\0')) {
if (strcasecmp(q, "absolute") == 0) {
i++;
}
else if (strcasecmp(q, "relative") == 0) {
i++;
}
i++;
classfound = 1;
classmatched = 1;
}
else if (strcmp(q, "-") == 0) {
i++;
options = 0;
}
else
options = 0;
}
if (!classfound || classmatched) {
int j;
if (((i + 1) < MAXARGS)
&& (q[0] != '\0')
&& (0 < path_compare(q, pwdir))
match_value = j;
if (((i + 2) < MAXARGS)
&& (q[0] != '\0'))
ap2 = q;
if (((i + 3) < MAXARGS)
&& (q[0] != '\0'))
ap3 = q;
if (((i + 4) < MAXARGS)
&& (q[0] != '\0'))
ap4 = q;
if (((i + 5) < MAXARGS)
&& (q[0] != '\0'))
ap5 = q;
if (((i + 6) < MAXARGS)
&& (q[0] != '\0'))
ap6 = q;
if (((i + 7) < MAXARGS)
&& (q[0] != '\0'))
ap7 = q;
}
}
}
if (anonymous && (match_value < 0)) {
return (0);
}
return (0);
}
if (ap3) {
else if (stat_result == 0)
}
if (ap4) {
else if (stat_result == 0)
}
if (ap7) {
*valid = 1;
}
else if (ap5) {
if (*d_mode & 0600)
*d_mode |= 0100;
if (*d_mode & 0060)
*d_mode |= 0010;
if (*d_mode & 0006)
*d_mode |= 0001;
*valid = 1;
}
return (1);
}
{
int match_value = -1;
char cwdir[MAXPATHLEN];
char *pwdir;
char abspwdir[MAXPATHLEN];
char relpwdir[MAXPATHLEN];
char path[MAXPATHLEN];
char *sp;
int stat_result = -1;
char class[1024];
extern char *home;
*valid = 0;
(void) acl_getclass(class);
/* what's our current directory? */
/* XXX We could use dynamic RAM to store this path, but I'd rather just bail
out with an error. The rest of wu is so crufy that a long path might
just blow up later */
return (-1);
}
if (sp)
*sp = '\0';
else
return (-1);
}
return (-1);
}
return (-1);
}
/*
* we are doing a "best match"... ..so we keep track of what "match
* value" we have received so far...
*/
char *q;
int i = 0;
int options = 1;
int classfound = 0;
int classmatched = 0;
while (options
&& (i < MAXARGS)
&& (q[0] != '\0')) {
if (strcasecmp(q, "absolute") == 0) {
i++;
}
else if (strcasecmp(q, "relative") == 0) {
i++;
}
i++;
classfound = 1;
classmatched = 1;
}
else if (strcmp(q, "-") == 0) {
i++;
options = 0;
}
else
options = 0;
}
if (!classfound || classmatched) {
int j;
if (((i + 1) < MAXARGS)
&& (q[0] != '\0')
&& (0 < path_compare(q, pwdir))
match_value = j;
if (((i + 2) < MAXARGS)
&& (q[0] != '\0'))
ap2 = q;
if (((i + 3) < MAXARGS)
&& (q[0] != '\0'))
ap3 = q;
if (((i + 4) < MAXARGS)
&& (q[0] != '\0'))
ap4 = q;
if (((i + 5) < MAXARGS)
&& (q[0] != '\0'))
ap5 = q;
}
}
}
if (ap3
/*
* if we did get matches ... else don't do any of this stuff
*/
if (match_value >= 0) {
if (ap3) {
else if (stat_result == 0)
}
if (ap4) {
else if (stat_result == 0)
*valid = 1;
}
if (ap5)
}
else {
return (-1);
}
}
else {
/*
* upload defaults to "permitted"
*/
/* Not if anonymous */
if (anonymous) {
return (-1);
}
return (1);
}
return (match_value);
}
{
if (type_match(ARG1))
if (anonymous) {
if (*ARG0 == 'y')
pdelete = 1;
}
else if (*ARG0 == 'n')
pdelete = 0;
}
/* H* fix: no deletion, period. You put a file here, I get to look at it. */
#ifdef PARANOID
pdelete = 0;
#endif
if (!pdelete) {
return (0);
}
else {
return (1);
}
}
/* The following is from the Debian add-ons. */
{
#ifdef M_UNIX
#ifdef HAVE_REGEX
char *regp;
#endif
#endif
#ifdef HAVE_REGEXEC
int rval;
#else
char *sp;
#endif
#if defined(HAVE_REGEXEC)
#elif defined(HAVE_REGEX)
#else
#endif
return (0);
}
#if defined(HAVE_REGEXEC)
if (rval != 0) {
#elif defined(HAVE_REGEX)
#ifdef M_UNIX
#else
#endif
#else
#endif
return (0);
}
return (1);
}
static int allow_retrieve(char *name)
{
char *whichname;
int i;
char *p, *q;
int options;
int classfound;
int classmatched;
char class[1024];
(void) acl_getclass(class);
|| (*name == '\0'))
return 0;
i = 0;
options = 1;
classfound = 0;
classmatched = 0;
while (options
&& (i < MAXARGS)
&& (q[0] != '\0')) {
if (strcasecmp(q, "absolute") == 0) {
i++;
}
else if (strcasecmp(q, "relative") == 0) {
i++;
}
i++;
classfound = 1;
classmatched = 1;
}
else if (strcmp(q, "-") == 0) {
i++;
options = 0;
}
else
options = 0;
}
if (!classfound || classmatched) {
return 1;
}
}
}
}
return 0;
}
int checknoretrieve(char *name)
{
char *whichname;
int i;
char *p, *q;
int options;
int classfound;
int classmatched;
char class[1024];
extern char *remoteident;
(void) acl_getclass(class);
|| (*name == '\0'))
return 0;
i = 0;
options = 1;
classfound = 0;
classmatched = 0;
while (options
&& (i < MAXARGS)
&& (q[0] != '\0')) {
if (strcasecmp(q, "absolute") == 0) {
i++;
}
else if (strcasecmp(q, "relative") == 0) {
i++;
}
i++;
classfound = 1;
classmatched = 1;
}
else if (strcmp(q, "-") == 0) {
i++;
options = 0;
}
else
options = 0;
}
if (!classfound || classmatched) {
if (!allow_retrieve(name)) {
return 1;
}
}
}
}
}
return 0;
}
#ifdef QUOTA
#ifndef MNTMAXSTR
#endif
#ifdef QUOTA_DEVICE
{
#ifdef HAS_OLDSTYLE_GETMNTENT
#else
#endif
struct mount_ent {
} mountent;
int flag = 1;
#ifdef HAS_OLDSTYLE_GETMNTENT
#else
#endif
return 0;
#ifdef HAS_OLDSTYLE_GETMNTENT
#else
#endif
{
perror("malloc");
flag = 0;
break;
}
if (!start)
else
#ifdef HAS_OLDSTYLE_GETMNTENT
#else
#endif
}
#ifdef HAS_OLDSTYLE_GETMNTENT
#else
#endif
flag = 0;
/* no support for remote quota yet */
}
}
}
else
}
while (current) {
}
return 1;
}
#endif
{
char mnt_fsname[MNTMAXSTR];
#ifdef HAS_NO_QUOTACTL
int dirfd;
#endif
/*
* Getting file system quota information can take a noticeable amount
* of time, so only get quota information for specified users.
* quota-info <uid-range> [<uid-range> ...]
*/
return;
#ifdef HAS_NO_QUOTACTL
}
#else
#ifdef QUOTA_DEVICE
#ifdef QCMD
#else
#endif
#else
#endif
#endif /* HAS_NO_QUOTACTL */
}
{
if (timelimit == 0) {
}
}
else {
}
}
else {
timeleft[0] = '\0';
}
return (timeleft);
}
{
int i;
static struct {
int c_secs; /* conversion units in secs */
char *c_str; /* unit string */
} cunits[] = {
{
60 *60 * 24 * 28, "months"
} ,
{
60 *60 * 24 * 7, "weeks"
} ,
{
60 *60 * 24, "days"
} ,
{
60 *60, "hours"
} ,
{
60, "mins"
} ,
{
1, "secs"
}
};
if (time <= 0) {
return;
}
break;
}
}
#endif
#ifdef THROUGHPUT
{
char *cp;
char *cp2;
int i;
int matches = 0;
buf[i++] = ',';
buf[i++] = '\0';
*cp2++ = '\0';
matches = 1;
break;
}
}
return matches;
}
int remote_compare(char *patterns)
{
char *cp;
char *cp2;
int i;
int matches = 0;
buf[i++] = ',';
buf[i++] = '\0';
*cp2++ = '\0';
matches = 1;
break;
}
}
return matches;
}
{
int match_value = -1;
char cwdir[MAXPATHLEN];
char pwdir[MAXPATHLEN];
char path[MAXPATHLEN];
char file[MAXPATHLEN];
extern char *home;
char *sp;
int i;
/* default is maximum throughput */
*bps = -1;
*bpsmult = 1.0;
/* XXX We could use dynamic RAM to store this path, but I'd rather just bail
out with an error. The rest of wu is so crufy that a long path might
just blow up later */
return;
}
/* what's our current directory? */
*sp = '\0';
else
else
return;
}
/* find best matching entry */
) {
if (remote_compare(ARG5)) {
match_value = i;
}
}
}
}
/* if we did get matches */
if (match_value >= 0) {
*bps = -1;
else
*bpsmult = 1.0;
else
}
return;
}
void throughput_adjust(char *name)
{
int match_value = -1;
char pwdir[MAXPATHLEN];
char cwdir[MAXPATHLEN];
char path[MAXPATHLEN];
char file[MAXPATHLEN];
char buf[MAXPATHLEN];
char **pap;
extern char *home;
char *sp;
int i;
/* XXX We could use dynamic RAM to store this path, but I'd rather just bail
out with an error. The rest of wu is so crufy that a long path might
just blow up later */
return;
}
/* what's our current directory? */
*sp = '\0';
else
else
return;
}
/* find best matching entry */
) {
if (remote_compare(ARG5)) {
match_value = i;
}
}
}
}
/* if we did get matches */
if (match_value >= 0) {
dologout(1);
}
/* Use ARG6 to keep track of malloced memory */
if (pap[6])
}
}
}
return;
}
#endif
#ifdef SOLARIS_2
static int CheckMethod = 1;
#else
static int CheckMethod = 0;
#endif
void SetCheckMethod(const char *method)
{
CheckMethod = 0;
CheckMethod = 1;
else {
return;
}
switch (CheckMethod) {
default:
break;
case 1:
break;
}
}
void ShowCheckMethod(void)
{
switch (CheckMethod) {
default:
break;
case 1:
break;
}
}
{
char *cmd;
char buf[MAXPATHLEN];
return;
}
}
else {
return;
}
switch (CheckMethod) {
default:
break;
case 1:
break;
}
return;
}
if (!cmdf) {
}
else {
*crptr = '\0';
}
}
}
void CheckSumLastFile(void)
{
extern char LastFileTransferred[];
if (LastFileTransferred[0] == '\0')
else
}