/*
* Copyright (c) 1999 Proofpoint, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
*/
/*
** The following test program tries the pathconf(2) routine. It should
** be run in a non-NFS-mounted directory (e.g., /tmp) and on remote (NFS)
** mounted directories running both NFS-v2 and NFS-v3 from systems that
** both do and do not permit file giveaway.
*/
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#ifdef EX_OK
#endif /* EX_OK */
#include <sysexits.h>
#ifndef lint
#endif /* ! lint */
int
int argc;
char **argv;
{
int fd;
int i;
extern int errno;
if (geteuid() == 0)
{
printf("*** Run me as a non-root user! ***\n");
}
if (fd < 0)
{
}
errno = 0;
errno = 0;
errno = 0;
if (errno == 0 && i >= 0)
{
/* so it claims that it doesn't work -- try anyhow */
printf(" fpathconf claims that chown is safe ");
printf("*** but fchown works anyhow! ***\n");
else
printf("and fchown agrees\n");
}
else
{
/* well, let's see what really happens */
printf(" fpathconf claims that chown is not safe ");
printf("as indeed it is not\n");
else
printf("*** but in fact it is safe ***\n");
}
}