-($Id: ChangeLog,v 1.50 2001-06-20 14:51:12 rufustfirefly Exp $)
+($Id: ChangeLog,v 1.51 2001-06-20 18:33:03 rufustfirefly Exp $)
2001-06-20 jeff b <jeff@univrel.pr.uconn.edu>
* configure.in: check for linux/quota.h before enabling
libatalk/util/module.c: removed NO_DLFCN_H in favor of
ifndef HAVE_DLFCN_H (Jeff)
+ * configure.in, etc/afpd/*.{c,h}, include/atalk/util.h:
+ major autoconf fixes for afpd, nicer commenting, etc (Jeff)
+
2001-06-19 jeff b <jeff@univrel.pr.uconn.edu>
* etc/afpd/file.c, etc/afpd/parse_mtab.c, etc/afpd/parse_mtab.h,
etc/atalkd/route.h, etc/atalkd/rtmp.c, etc/papd/headers.c,
-dnl $Id: configure.in,v 1.91 2001-06-20 14:51:12 rufustfirefly Exp $
+dnl $Id: configure.in,v 1.92 2001-06-20 18:33:03 rufustfirefly Exp $
dnl configure.in for netatalk
AC_INIT(bin/adv1tov2/adv1tov2.c)
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h sys/types.h)
+AC_CHECK_HEADERS(fcntl.h limits.h stdint.h strings.h sys/fcntl.h sys/file.h sys/ioctl.h sys/time.h sys/mnttab.h sys/statvfs.h sys/stat.h sys/vfs.h mntent.h syslog.h unistd.h termios.h sys/termios.h netdb.h sgtty.h ufs/quota.h mount.h sys/mount.h statfs.h sys/types.h dlfcn.h)
AC_CHECK_HEADER(sys/cdefs.h,,
AC_MSG_RESULT([enabling generic cdefs.h from tree])
CFLAGS="-I\$(top_srcdir)/sys/generic $CFLAGS"
AC_DEFINE(ADMIN_GRP, 1)
AC_ARG_WITH(admin-group,
- [ --disable-admin-group disable admin group],
+ [ --disable-admin-group disable admin group],
if test "$enableval" = "no"; then
AC_DEFINE(ADMIN_GRP, 0)
AC_MSG_RESULT([disabling administrative group support])
)
AC_ARG_ENABLE(afs,
- [ --enable-afs enable AFS support],
+ [ --enable-afs enable AFS support],
if test "$enableval" = "yes"; then
AC_DEFINE(AFS, 1)
AC_MSG_RESULT([enabling AFS support])
)
AC_ARG_WITH(pkgconfdir,
- [ --with-pkgconfdir=DIR package specific configuration in DIR [default=SYSCONF/netatalk]],
+ [ --with-pkgconfdir=DIR package specific configuration in DIR
+ [default=SYSCONF/netatalk]],
PKGCONFDIR="$withval",
PKGCONFDIR="${sysconfdir}/netatalk"
)
)
AC_ARG_WITH(did,
- [ --with-did=[scheme] set DID scheme (last,mtab)],
+ [ --with-did=[scheme] set DID scheme (last,mtab)],
if test "x$withval" != "xno" ; then
if test "$withval" = "last"; then
AC_DEFINE(USE_LASTDID, 1)
LDSHAREDFLAGS="-shared"
dnl ----- check if we need the quotactl wrapper
- AC_CHECK_HEADER(sys/quota.h,
- sys_quota=yes,
- sys_quota=no
- )
- AC_CHECK_HEADER(linux/quota.h,
- linux_quota=yes,
- linux_quota=no
- )
-
- if test "x$linux_quota" = "xno" -a "x$sys_quota" = "xno"; then
- AC_MSG_RESULT([enabling quotactl wrapper])
+ AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
+ AC_CHECK_FUNC(quotactl,,
AC_DEFINE(NEED_QUOTACTL_WRAPPER)
- fi
+ AC_MSG_RESULT([enabling quotactl wrapper])
+ )
dnl ----- as far as I can tell, dbtob always does the wrong thing
dnl ----- on every single version of linux I've ever played with.
/*
+ * $Id: afp_asp.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#ifndef NO_DDP
#include <string.h>
#include <signal.h>
#include <syslog.h>
+#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
#include <netatalk/endian.h>
#include <atalk/atp.h>
if ( obj->options.flags & OPTION_DEBUG ) {
#ifdef notdef
pdesc( stdout );
-#endif notdef
+#endif /* notdef */
of_pforkdesc( stdout );
fflush( stdout );
}
/*
+ * $Id: afp_config.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <ctype.h>
#include <syslog.h>
if ((options->transports & AFPTRANS_DDP) &&
(config = ASPConfigInit(options, refcount)))
config->defoptions = defoptions;
-#endif
+#endif /* NO_DDP */
/* handle dsi transports and dsi proxies. we only proxy
* for DSI connections. */
+/*
+ * $Id: afp_config.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
#ifndef AFPD_CONFIG_H
#define AFPD_CONFIG_H 1
+#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
+#endif /* HAVE_SYS_CDEFS_H */
+
#include <atalk/server_child.h>
#include <atalk/atp.h>
#include "globals.h"
extern AFPConfig *configinit __P((struct afp_options *));
extern void configfree __P((AFPConfig *, const AFPConfig *));
+
#endif
/*
+ * $Id: afp_dsi.c,v 1.8 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/socket.h>
#include <sys/time.h>
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
#include <netinet/in.h>
#include <arpa/inet.h>
#include <syslog.h>
readmessage();
dsi_attention(child.obj->handle, AFPATTN_MESG | AFPATTN_TIME(5));
}
-#endif
+#endif /* SERVERTEXT */
static void alarm_handler()
{
syslog( LOG_ERR, "afp_over_dsi: sigaction: %m" );
afp_dsi_die(1);
}
-#endif
+#endif /* SERVERTEXT */
/* tickle handler */
action.sa_handler = alarm_handler;
}
writtenfork = NULL;
}
-#endif AFS
+#endif /* AFS */
function = (u_char) dsi->commands[0];
if (obj->options.flags & OPTION_DEBUG ) {
if ( obj->options.flags & OPTION_DEBUG ) {
#ifdef notdef
pdesc( stdout );
-#endif notdef
+#endif /* notdef */
of_pforkdesc( stdout );
fflush( stdout );
}
/*
+ * $Id: afp_options.c,v 1.7 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/param.h>
#include <sys/socket.h>
#include <syslog.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include <atalk/paths.h>
#include <atalk/util.h>
#ifdef ADMIN_GRP
#include <grp.h>
#include <sys/types.h>
-#endif
+#endif /* ADMIN_GRP */
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* MIN */
#define OPTIONS "dn:f:s:uc:g:P:ptDS:TL:F:U:I"
#define LENGTH 512
options->authprintdir = NULL;
#ifdef ADMIN_GRP
options->admingid = 0;
-#endif ADMIN_GRP
+#endif /* ADMIN_GRP */
}
/* parse an afpd.conf line. i'm doing it this way because it's
options->admingid = gr->gr_gid;
}
}
-#endif
+#endif /* ADMIN_GRP */
if ((c = getoption(buf, "-authprintdir")) && (opt = strdup(c)))
options->authprintdir = opt;
#ifdef ultrix
openlog( p, LOG_PID );
-#else ultrix
+#else /* ultrix */
openlog( p, LOG_NDELAY|LOG_PID, LOG_DAEMON);
-#endif ultrix
+#endif /* ultrix */
return 1;
}
/*
+ * $Id: afs.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#ifdef AFS
#include <afs/venus.h>
#include <afs/afsint.h>
#include <atalk/afp.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include "globals.h"
#include "directory.h"
return( AFP_OK );
}
-#endif UAM_AFSKRB
-#endif AFS
+#endif /* UAM_AFSKRB */
+#endif /* AFS */
/*
+ * $Id: appl.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
len--;
}
}
-#endif APPLCNAME
+#endif /* APPLCNAME */
/* fake up a cname */
cbuf = obj->newtmp;
return( AFP_OK );
}
-
/*
+ * $Id: auth.c,v 1.15 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#ifdef SHADOWPW
#include <shadow.h>
-#endif
+#endif /* SHADOWPW */
#include <pwd.h>
#include <grp.h>
if (initgroups( pwd->pw_name, pwd->pw_gid ) < 0) {
#ifdef RUN_AS_USER
syslog(LOG_INFO, "running with uid %d", geteuid());
-#else
+#else /* RUN_AS_USER */
syslog(LOG_ERR, "login: %m");
return AFPERR_BADUAM;
-#endif
+#endif /* RUN_AS_USER */
}
#ifdef ADMIN_GRP
#ifdef DEBUG
syslog(LOG_INFO, "obj->options.admingid == %d", obj->options.admingid);
-#endif DEBUG
+#endif /* DEBUG */
if (obj->options.admingid != 0) {
int i;
for (i = 0; i < ngroups; i++) {
}
if (admin) syslog( LOG_INFO, "admin login -- %s", pwd->pw_name );
if (!admin)
-#endif
+#endif /* DEBUG */
if (setegid( pwd->pw_gid ) < 0 || seteuid( pwd->pw_uid ) < 0) {
syslog( LOG_ERR, "login: %m" );
return AFPERR_BADUAM;
#ifdef ADMIN_GRP
if (admin) uuid = 0;
else
-#endif ADMIN_GRP
+#endif /* ADMIN_GRP */
uuid = pwd->pw_uid;
afp_switch = postauth_switch;
/*
+ * $Id: auth.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifndef AFPD_AUTH_H
#define AFPD_AUTH_H 1
+#ifdef HAVE_LIMITS_H
#include <limits.h>
+#endif /* HAVE_LIMITS_H */
+
+#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
+#endif /* HAVE_SYS_CDEFS_H */
+
#include "globals.h"
struct afp_versions {
extern int afp_changepw __P((AFPObj *, char *, int, char *, int *));
extern int afp_logout __P((AFPObj *, char *, int, char *, int *));
extern int afp_getuserinfo __P((AFPObj *, char *, int, char *, int *));
+
#endif /* auth.h */
/*
- * $Id: codepage.c,v 1.4 2001-05-31 18:48:32 srittau Exp $
+ * $Id: codepage.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 2000 Adrian Sun
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <syslog.h>
#include <netatalk/endian.h>
{
#if 0
union codepage_val *ptr;
-#endif
+#endif /* 0 */
if (page->quantum < 1) /* no quantum given. don't do anything */
return 1;
map[*from].hash
}
-#endif
+#endif /* 0 */
return 0;
}
+/*
+ * $Id: codepage.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
#ifndef AFPD_CODEPAGE_H
#define AFPD_CODEPAGE_H 1
#define CODEPAGE_BADCHAR_SET (1 << 0)
#define CODEPAGE_BADCHAR_ANYWHERE (1 << 1)
#define CODEPAGE_BADCHAR_QUANTUM (1 << 2)
+
#endif
/*
- * $Id: desktop.c,v 1.4 2001-05-31 18:48:32 srittau Exp $
+ * $Id: desktop.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/syslog.h>
#include <errno.h>
#include <atalk/adouble.h>
#include <atalk/util.h>
#include <dirent.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_FCNTL_H
#include <unistd.h>
+#endif /* HAVE_FCNTL_H */
#include "volume.h"
#include "directory.h"
#ifdef SENDFILE_FLAVOR_LINUX
if (sendfile(dsi->socket, si.sdt_fd, &offset, dsi->datasize) < 0)
goto geticon_exit;
-#endif
+#endif /* SENDFILE_FLAVOR_LINUX */
#ifdef SENDFILE_FLAVOR_BSD
if (sendfile(si.sdt_fd, dsi->socket, offset, rc, NULL, NULL, 0) < 0)
goto geticon_exit;
-#endif
+#endif /* SENDFILE_FLAVOR_BSD */
goto geticon_done;
}
-#endif
+#endif /* SENDFILE_FLAVOR_LINUX || SENDFILE_FLAVOR_BSD */
buflen = read(si.sdt_fd, rbuf, *rbuflen);
if (buflen < 0)
vol->v_flags & AFPVOL_MAPASCII)) {
*u = vol->v_mtoupage->map[*m].value;
} else
-#endif
+#endif /* 1 */
#if AD_VERSION == AD_VERSION1
if ((((vol->v_flags & AFPVOL_NOHEX) == 0) &&
(!isascii(*m) || *m == '/')) ||
(((vol->v_flags & AFPVOL_USEDOTS) == 0) &&
( i == 0 && (*m == '.' )))) {
-#else
+#else /* AD_VERSION == AD_VERSION1 */
if ((((vol->v_flags & AFPVOL_NOHEX) == 0) &&
(!isprint(*m) || *m == '/')) ||
(((vol->v_flags & AFPVOL_USEDOTS) == 0) &&
( i == 0 && (*m == '.' )))) {
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
/* do hex conversion. */
*u++ = ':';
*u++ = hexdig[ ( *m & 0xf0 ) >> 4 ];
(vol->v_flags & AFPVOL_MAPASCII))) {
*m = vol->v_utompage->map[*u].value;
} else
-#endif
+#endif /* 1 */
if ( *u == ':' && *(u+1) != '\0' && islxdigit( *(u+1)) &&
*(u+2) != '\0' && islxdigit( *(u+2))) {
++u;
/*
+ * $Id: desktop.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
extern int afp_addicon __P((AFPObj *, char *, int, char *, int *));
extern int afp_geticoninfo __P((AFPObj *, char *, int, char *, int *));
extern int afp_geticon __P((AFPObj *, char *, int, char *, int *));
+
#endif
/*
- * $Id: directory.c,v 1.11 2001-06-06 13:36:36 rufustfirefly Exp $
+ * $Id: directory.c,v 1.12 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/syslog.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <grp.h>
#include <pwd.h>
#include <string.h>
#ifdef FORCE_UIDGID
#include "uid.h"
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
struct dir *curdir;
return dir;
}
-#endif
+#endif /* 0 */
/* remove the node from the tree. this is just like insertion, but
#ifdef REMOVE_NODES
struct ofork *of, *last;
struct dir *node, *leaf;
-#endif
+#endif /* REMOVE_NODES */
if (!dir || (dir == SENTINEL))
return;
#ifndef REMOVE_NODES
free(dir->d_name);
dir->d_name = NULL;
-#else
+#else /* ! REMOVE_NODES */
/* go searching for a node with at most one child */
if ((dir->d_left == SENTINEL) || (dir->d_right == SENTINEL)) {
dir_rmrecolor(vol, leaf);
free(node->d_name);
free(node);
-#endif
+#endif /* ! REMOVE_NODES */
}
data++;
len--;
}
-#endif notdef
+#endif /* notdef */
*p = '\0';
if ( p != path ) { /* we got something */
u_int16_t ashort;
#ifdef FORCE_UIDGID
uidgidset *uidgid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
memset(&ad, 0, sizeof(ad));
#ifdef FORCE_UIDGID
save_uidgid ( uidgid );
set_uidgid ( vol );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
if ( ad_open( upath, ADFLAGS_HF|ADFLAGS_DIR, O_RDONLY,
DIRBITS | 0777, &ad) < 0 ) {
#ifndef SENDFILE_FLAVOR_LINUX /* ignore this section if it's linux */
#ifdef HAVE_ACCESS
accessmode( upath, &ma, dir );
-#endif HAVE_ACCESS
-#endif SENDFILE_FLAVOR_LINUX
+#endif /* HAVE_ACCESS */
+#endif /* SENDFILE_FLAVOR_LINUX */
#ifdef AFS /* If only AFS defined, access() works only for AFS filesystems */
afsmode( upath, &ma, dir );
-#endif AFS
+#endif /* AFS */
*data++ = ma.ma_user;
*data++ = ma.ma_world;
*data++ = ma.ma_group;
}
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_BITMAP );
}
bitmap = bitmap>>1;
int err = AFP_OK;
#ifdef FORCE_UIDGID
uidgidset *uidgid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
upath = mtoupath(vol, path);
memset(&ad, 0, sizeof(ad));
#ifdef FORCE_UIDGID
save_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
if (ad_open( upath, vol_noadouble(vol)|ADFLAGS_HF|ADFLAGS_DIR,
O_RDWR|O_CREAT, 0666, &ad) < 0) {
/*
(1<<DIRPBIT_MDATE)|(1<<DIRPBIT_PDINFO)))) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_ACCESS;
}
}
break;
}
-#endif
+#endif /* 0 */
if ( setdirowner( -1, ntohl(aint), vol_noadouble(vol) ) < 0 ) {
switch ( errno ) {
goto setdirparam_done;
}
}
-#endif
+#endif /* 0 */
if ( setdirmode( mtoumode( &ma ), vol_noadouble(vol),
(vol->v_flags & AFPVOL_DROPBOX)) < 0 ) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return err;
}
u_int16_t vid;
#ifdef FORCE_UIDGID
uidgidset *uidgid;
-#endif FORCE_UIDGID
+
+ /* allocate memory */
+ uidgidset = malloc(sizeof(uidgidset));
+#endif /* FORCE_UIDGID */
*rbuflen = 0;
ibuf += 2;
#ifdef FORCE_UIDGID
save_uidgid ( uidgid );
set_uidgid ( vol );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
if ( ad_mkdir( upath, DIRBITS | 0777 ) < 0 ) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
switch ( errno ) {
case ENOENT :
return( AFPERR_NOOBJ );
if (stat(upath, &st) < 0) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_MISC;
}
strlen(upath), &st)) == NULL) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_MISC;
}
if ( movecwd( vol, dir ) < 0 ) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_PARAM );
}
goto createdir_done;
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_ACCESS );
}
setvoltime(obj, vol );
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFP_OK );
}
DIR *dp;
#ifdef FORCE_UIDGID
uidgidset *uidgid;
-#endif FORCE_UIDGID
+
+ uidgid = malloc(sizeof(uidgidset));
+#endif /* FORCE_UIDGID */
if ( curdir->d_parent == NULL ) {
return( AFPERR_ACCESS );
#ifdef FORCE_UIDGID
save_uidgid ( uidgid );
set_uidgid ( vol );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
/* delete stray .AppleDouble files. this happens to get .Parent files
as well. */
closedir(dp);
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_DIRNEMPT;
}
case EACCES :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_ACCESS );
case EROFS:
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_VLOCK;
case ENOENT :
continue;
default :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_PARAM );
}
}
case ENOTEMPTY :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_DIRNEMPT );
case EROFS:
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_VLOCK;
case EPERM:
case EACCES :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_ACCESS );
default :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_PARAM );
}
}
if ((lstat(de->d_name, &st) == 0) && !S_ISLNK(st.st_mode)) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_DIRNEMPT;
}
case EACCES :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_ACCESS );
case EROFS:
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_VLOCK;
case ENOENT :
continue;
default :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_PARAM );
}
}
if ( movecwd( vol, curdir->d_parent ) < 0 ) {
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_NOOBJ );
}
case ENOENT :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_NOOBJ );
case ENOTEMPTY :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_DIRNEMPT );
case EPERM:
case EACCES :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_ACCESS );
case EROFS:
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return AFPERR_VLOCK;
default :
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFPERR_PARAM );
}
}
dirchildremove(curdir, fdir);
#if AD_VERSION > AD_VERSION1
cnid_delete(vol->v_db, fdir->d_did);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
dir_remove( vol, fdir );
#ifdef FORCE_UIDGID
restore_uidgid ( uidgid );
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
return( AFP_OK );
}
struct dir *dir;
u_int16_t vid;
u_int32_t did;
-#endif
+#endif /* 0 */
*rbuflen = 0;
}
/* dir_remove -- deletedid */
-#endif
+#endif /* 0 */
return AFP_OK;
}
u_int16_t vid;
#ifdef FORCE_UIDGID
uidgidset *uidgid;
+
+ uidgid = malloc(sizeof(uidgidset));
#endif /* FORCE_UIDGID */
*rbuflen = 0;
/*
+ * $Id: directory.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
/* setgid directories */
#ifndef DIRBITS
#define DIRBITS S_ISGID
-#endif
+#endif /* DIRBITS */
#define DIRF_FSMASK (3<<0)
#define DIRF_NOFS (0<<0)
& 0x00ffffff)
#define CNID_FILE(a) (((a) & 0x1) << 31)
#define CNID(a,b) (CNID_DEV(a) | CNID_INODE(a) | CNID_FILE(b))
-#else
+#else /* AFS */
#define CNID(a,b) (((a)->st_ino & 0x7fffffff) | CNID_FILE(b))
-#endif
+#endif /* AFS */
struct maccess {
/*
- * $Id: enumerate.c,v 1.4 2001-06-06 13:36:36 rufustfirefly Exp $
+ * $Id: enumerate.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
struct dir *cdir, *edir;
#if AD_VERSION > AD_VERSION1
struct adouble ad;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
#ifndef USE_LASTDID
struct stat lst, *lstp;
/*
- * $Id: file.c,v 1.21 2001-06-19 18:04:39 rufustfirefly Exp $
+ * $Id: file.c,v 1.22 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <string.h>
#include <utime.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <dirent.h>
#include <sys/mman.h>
#include <errno.h>
#ifdef FORCE_UIDGID
uidgidset *uidgid;
+
+ uidgid = malloc(sizeof(uidgidset));
#endif /* FORCE_UIDGID */
#ifdef DEBUG
/*
+ * $Id: file.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
extern int afp_createid __P((AFPObj *, char *, int, char *, int *));
extern int afp_resolveid __P((AFPObj *, char *, int, char *, int *));
extern int afp_deleteid __P((AFPObj *, char *, int, char *, int *));
-#else
+#else /* AD_VERSION > AD_VERSION1 */
#define afp_createid afp_null
#define afp_resolveid afp_null
#define afp_deleteid afp_null
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
#endif
/*
- * $Id: filedir.c,v 1.9 2001-06-06 19:04:25 rufustfirefly Exp $
+ * $Id: filedir.c,v 1.10 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include <atalk/cnid.h>
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <dirent.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include "directory.h"
#include "desktop.h"
u_int16_t vid;
#if AD_VERSION > AD_VERSION1
cnid_t id;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
#ifdef DEBUG
syslog(LOG_INFO, "begin afp_rename:");
#if AD_VERSION > AD_VERSION1
id = cnid_get(vol->v_db, curdir->d_did, upath, strlen(upath));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
if ( rename( upath, newpath ) < 0 ) {
switch ( errno ) {
if (stat(newpath, &st) < 0) /* this shouldn't fail */
return AFPERR_MISC;
cnid_update(vol->v_db, id, &st, curdir->d_did, newpath, strlen(newpath));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
if ( !odir ) {
newadpath = obj->newtmp;
#if AD_VERSION > AD_VERSION1 /* get rid of entry */
cnid_t id = cnid_get(vol->v_db, curdir->d_did, upath, strlen(upath));
cnid_delete(vol->v_db, id);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
}
if ( rc == AFP_OK ) {
setvoltime(obj, vol );
u_int16_t vid;
#if AD_VERSION > AD_VERSION1
cnid_t id;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
#ifdef DROPKLUDGE
int retvalue;
#endif /* DROPKLUDGE */
#if AD_VERSION > AD_VERSION1
p = mtoupath(vol, path);
id = cnid_get(vol->v_db, sdir->d_did, p, strlen(p));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
p = ctoupath( vol, sdir, newname );
} else {
odir = curdir;
p = ctoupath( vol, odir->d_parent, newname );
#if AD_VERSION > AD_VERSION1
id = curdir->d_did; /* we already have the CNID */
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
}
/*
* p now points to the full pathname of the source fs object.
/* fix up the catalog entry */
cnid_update(vol->v_db, id, &st, curdir->d_did, upath, strlen(upath));
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
setvoltime(obj, vol );
}
+/*
+ * $Id: filedir.h,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
#ifndef AFPD_FILEDIR_H
#define AFPD_FILEDIR_H 1
int *));
extern int afp_setfildirparams __P((AFPObj *, char *, int, char *,
int *));
+
#endif
/*
- * $Id: fork.c,v 1.4 2001-06-04 19:06:15 rufustfirefly Exp $
+ * $Id: fork.c,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <dirent.h>
#include <string.h>
#include <errno.h>
if (!(aint = cnid_add(ofork->of_vol->v_db, &st,
ofork->of_dir->d_did,
upath, strlen(upath), aint))) {
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
#ifdef AFS
aint = st.st_ino;
-#else AFS
+#else /* AFS */
aint = ( st.st_dev << 16 ) | ( st.st_ino & 0x0000ffff );
-#endif AFS
+#endif /* AFS */
#if AD_VERSION > AD_VERSION1
}
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
memcpy(data, &aint, sizeof( aint ));
data += sizeof( aint );
break;
if ( flushfork( ofork ) < 0 ) {
syslog( LOG_ERR, "afp_setforkparams: flushfork: %m" );
}
-#endif AFS
+#endif /* AFS */
return( AFP_OK );
}
afp_read_loop:
-#endif
+#endif /* HAVE_SENDFILE_READ */
/* fill up our buffer. */
while (*rbuflen > 0) {
#ifdef AFS
writtenfork = ofork;
-#endif AFS
+#endif /* AFS */
if ( ofork->of_flags & AFPFORK_DATA) {
eid = ADEID_DFORK;
offset += cc;
goto afp_write_done;
}
-#endif
+#endif /* 0, was HAVE_SENDFILE_WRITE */
/* loop until everything gets written. currently
* dsi_write handles the end case by itself. */
offset = htonl( offset );
#if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
bcopy(&offset, rbuf, sizeof(offset));
-#else
+#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
memcpy(rbuf, &offset, sizeof(offset));
-#endif
+#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
*rbuflen = sizeof(offset);
return( AFP_OK );
/*
+ * $Id: fork.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
extern int afp_flushfork __P((AFPObj *, char *, int, char *, int *));
extern int afp_flush __P((AFPObj *, char *, int, char *, int *));
extern int afp_closefork __P((AFPObj *, char *, int, char *, int *));
+
#endif
/*
+ * $Id: gettok.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/param.h>
#include <string.h>
}
return;
}
-#endif notdef
+#endif /* notdef */
/*
+ * $Id: globals.h,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef ADMIN_GRP
#include <grp.h>
#include <sys/types.h>
-#endif
+#endif /* ADMIN_GRP */
+#ifdef HAVE_NETDB_H
#include <netdb.h> /* this isn't header-protected under ultrix */
+#endif /* HAVE_NETDB_H */
+
#include <netatalk/at.h>
#include <atalk/afp.h>
#include <atalk/compat.h>
#define MACFILELEN 31
-
#define OPTION_DEBUG (1 << 0)
#define OPTION_USERVOLFIRST (1 << 1)
#define OPTION_NOUSERVOL (1 << 2)
char *authprintdir;
#ifdef ADMIN_GRP
gid_t admingid;
-#endif ADMIN_GRP
+#endif /* ADMIN_GRP */
};
#define AFPOBJ_TMPSIZ (MAXPATHLEN)
#ifndef NO_DDP
extern void afp_over_asp __P((AFPObj *));
-#endif
+#endif /* NO_DDP */
extern void afp_over_dsi __P((AFPObj *));
#endif /* globals.h */
/*
+ * $Id: icon.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#endif /*sun*/
#endif /*vax*/
#endif /*ultrix*/
+
#endif
/*
- * $Id: main.c,v 1.8 2001-06-07 17:18:26 rufustfirefly Exp $
+ * $Id: main.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <signal.h>
#include <sys/types.h>
{
#ifndef NO_DDP
asp_kill(sig);
-#endif
+#endif /* ! NO_DDP */
dsi_kill(sig);
switch( sig ) {
case SIGTERM :
/*
+ * $Id: messages.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
#include <atalk/afp.h>
#include <syslog.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include "globals.h"
#include "misc.h"
#ifdef DEBUG
syslog (LOG_DEBUG, "Reading file %s ", filename);
-#endif
+#endif /* DEBUG */
message=fopen(filename, "r");
if (message==NULL) {
}
syslog (LOG_INFO, "Set server message to \"%s\"", servermesg);
-#endif
+#endif /* DEBUG */
}
free(filename);
-#endif
+#endif /* SERVERTEXT */
}
int afp_getsrvrmesg(obj, ibuf, ibuflen, rbuf, rbuflen)
+/*
+ * $Id: misc.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
#ifndef AFPD_MISC_H
#define AFPD_MISC_H 1
extern int afp_getsrvrmesg __P((AFPObj *, char *, int, char *, int *));
/* afs.c */
-# ifdef AFS
+#ifdef AFS
extern int afp_getdiracl __P((AFPObj *, char *, int, char *, int *));
extern int afp_setdiracl __P((AFPObj *, char *, int, char *, int *));
-# else AFS
+#else /* AFS */
#define afp_getdiracl NULL
#define afp_setdiracl NULL
-# endif AFS
+#endif /* AFS */
-# if defined( AFS ) && defined( UAM_AFSKRB )
+#if defined( AFS ) && defined( UAM_AFSKRB )
extern int afp_afschangepw __P((AFPObj *, char *, int, char *, int *));
-# else AFS UAM_AFSKRB
+#else /* AFS && UAM_AFSKRB */
#define afp_afschangepw NULL
-# endif AFS UAM_AFSKRB
+#endif /* AFS && UAM_AFSKRB */
#endif
-/* parts of this are lifted from the bsd quota program and are
+/*
+ * $Id: nfsquota.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
+ * parts of this are lifted from the bsd quota program and are
* therefore under the following copyright:
*
* Copyright (c) 1980, 1990, 1993
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <string.h>
#include <sys/time.h> /* <rpc/rpc.h> on ultrix doesn't include this */
#include <syslog.h>
+#ifdef HAVE_NETDB_H
#include <netdb.h>
+#endif /* HAVE_NETDB_H */
#include <netinet/in.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#ifdef USE_OLD_RQUOTA
#define GQR_STATUS gqr_status
#define GQR_RQUOTA gqr_rquota
-#else
+#else /* USE_OLD_RQUOTA */
#define GQR_STATUS status
#define GQR_RQUOTA getquota_rslt_u.gqr_rquota
-#endif
+#endif /* USE_OLD_RQUOTA */
int getnfsquota(const struct vol *vol, const int uid, const u_int32_t bsize,
struct dqblk *dqp)
#ifdef __svr4__
/* why doesn't using bsize work? */
#define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / DEV_BSIZE)
-#else
+#else /* __svr4__ */
/* NOTE: linux' rquotad program doesn't currently report the
* correct rq_bsize. */
#define NFS_BSIZE (gq_rslt.GQR_RQUOTA.rq_bsize / bsize)
-#endif
+#endif /* __svr4__ */
dqp->dqb_bhardlimit =
gq_rslt.GQR_RQUOTA.rq_bhardlimit*NFS_BSIZE;
#ifdef ultrix
dqp->dqb_bwarn = gq_rslt.GQR_RQUOTA.rq_btimeleft;
-#else
+#else /* ultrix */
dqp->dqb_btimelimit =
tv.tv_sec + gq_rslt.GQR_RQUOTA.rq_btimeleft;
-#endif
+#endif /* ultrix */
*hostpath = ':';
return AFP_OK;
*hostpath = ':';
return AFPERR_PARAM;
}
-#endif
+#endif /* ! NO_QUOTA_SUPPORT */
/*
- * $Id: ofork.c,v 1.3 2001-03-21 14:36:36 rufustfirefly Exp $
+ * $Id: ofork.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1996 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
/*
+ * $Id: passwd.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <itc.h>
#include <stdio.h>
/*
- * $Id: quota.c,v 1.8 2001-06-20 14:51:13 rufustfirefly Exp $
+ * $Id: quota.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/param.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <syslog.h>
#include <atalk/afp.h>
/*
+ * $Id: status.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <sys/param.h>
#ifndef USE_GETHOSTID
#include <sys/sysctl.h>
-#endif
-#endif
+#endif /* USE_GETHOSTID */
+#endif /* BSD4_4 */
#include <netatalk/at.h>
#include <netatalk/endian.h>
int len;
#ifdef AFS
const char *machine = "afs";
-#else !AFS
+#else /* !AFS */
const char *machine = "unix";
-#endif
+#endif /* AFS */
memcpy(&status, start + AFPSTATUS_MACHOFF, sizeof(status));
data += ntohs( status );
#ifdef BSD4_4
int mib[2];
size_t len;
-#endif
+#endif /* BSD4_4 */
status = data;
mib[1] = KERN_HOSTID;
len = sizeof(hostid);
sysctl(mib, 2, &hostid, &len, NULL, 0);
-#else
+#else /* BSD4_4 && USE_GETHOSTID */
hostid = gethostid();
-#endif
+#endif /* BSD4_4 && USE_GETHOSTID */
if (!hostid) {
if (dsi)
hostid = dsi->server.sin_addr.s_addr;
memcpy(data, &ddpaddr->sat_port, sizeof(ddpaddr->sat_port));
data += sizeof(ddpaddr->sat_port);
}
-#endif
+#endif /* ! NO_DDP */
/* return length of buffer */
return (data - begin);
aspconfig->signature = status + sigoff;
aspconfig->statuslen = c;
}
-#endif
+#endif /* ! NO_DDP */
if (dsiconfig) {
if (aspconfig) { /* copy to dsiconfig */
+/*
+ * $Id: status.h,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ */
+
#ifndef AFPD_STATUS_H
#define AFPD_STATUS_H 1
/*
+ * $Id: switch.c,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h> /* to pick up NULL */
#include <sys/stat.h> /* works around a bug */
/*
+ * $Id: switch.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
extern int (**afp_switch)();
extern int (*postauth_switch[])();
+
#endif
/*
- * $Id: uam.c,v 1.8 2001-05-31 18:48:32 srittau Exp $
+ * $Id: uam.c,v 1.9 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <ctype.h>
#include <syslog.h>
#include <sys/param.h>
#include <sys/time.h>
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif /* HAVE_DLFCN_H */
#ifdef SHADOWPW
#include <shadow.h>
-#endif SHADOWPW
+#endif /* SHADOWPW */
#include <netatalk/endian.h>
#include <atalk/asp.h>
}
}
endpwent();
-#endif
+#endif /* ! NO_REAL_USER_NAME */
/* os x server doesn't keep anything useful if we do getpwent */
return pwent ? getpwnam(name) : NULL;
-/* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
+/*
+ * $Id: uam_auth.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $
+ *
+ * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
*
* interface between uam.c and auth.c
(a)->uam_next->uam_prev = (a)->uam_prev; \
} while (0)
-
extern struct uam_mod *uam_load __P((const char *, const char *));
extern void uam_unload __P((struct uam_mod *));
/*
- * $Id: uid.c,v 1.3 2001-02-23 22:16:15 rufustfirefly Exp $
+ * $Id: uid.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
* code: jeff@univrel.pr.uconn.edu
*
* These functions are abstracted here, so that all calls for resolving
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
/* don't compile this file at all unless FORCE_UIDGID is set */
#ifdef FORCE_UIDGID
#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
+#endif /* HAVE_UNISTD_H */
void save_uidgid ( pair )
uidgidset *pair;
{
+ /* allocate the memory */
+ pair = malloc ( sizeof ( uidgidset ) );
+
+ /* then assign the values */
(pair)->uid = geteuid ();
(pair)->gid = getegid ();
} /* end function void save_uidgid ( pair ) */
{
struct passwd *this_passwd;
+ /* free memory for pointer */
+ this_passwd = malloc ( sizeof ( struct passwd ) );
+
/* check for anything */
if ( strlen ( username ) < 1 ) return 0;
{
struct group *this_group;
+ /* free memory for pointer */
+ this_group = malloc ( sizeof ( struct group ) );
+
/* check for anything */
if ( strlen ( group ) < 1 ) return 0;
} /* end function int group_to_gid ( group ) */
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
/*
- * $Id: unix.h,v 1.6 2001-05-22 19:13:36 rufustfirefly Exp $
+ * $Id: unix.h,v 1.7 2001-06-20 18:33:04 rufustfirefly Exp $
*/
#ifndef AFPD_UNIX_H
#define AFPD_UNIX_H
+#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
+#endif /* HAVE_SYS_CDEFS_H */
#include <netatalk/endian.h>
#include "volume.h"
#endif /*i386*/
#endif /*sun __svr4__*/
-
-/* some GLIBC/old-libc-isms */
-#if defined(__GNU_LIBRARY__)
-#if __GNU_LIBRARY__ < 6
-#define HAVE_SYS_VFS_H
-#else
-#define HAVE_STATFS_H
-#endif
-#endif
-
#if defined(HAVE_SYS_VFS_H) || defined( sun ) || defined( ibm032 )
#include <sys/vfs.h>
#endif /* HAVE_SYS_VFS_H || sun || ibm032 */
/*
- * $Id: volume.c,v 1.7 2001-05-31 18:48:32 srittau Exp $
+ * $Id: volume.c,v 1.8 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include <sys/time.h>
#include <sys/syslog.h>
#include <atalk/util.h>
#include <atalk/cnid.h>
#include <dirent.h>
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
+#endif /* ! MIN */
#ifndef NO_LARGE_VOL_SUPPORT
#if BYTE_ORDER == BIG_ENDIAN
#define hton64(x) (x)
#define ntoh64(x) (x)
-#else
+#else /* BYTE_ORDER == BIG_ENDIAN */
#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
(u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
#define ntoh64(x) (hton64(x))
-#endif
-#endif
+#endif /* BYTE_ORDER == BIG_ENDIAN */
+#endif /* ! NO_LARGE_VOL_SUPPORT */
static struct vol *volumes = NULL;
static int lastvid = 0;
#if AD_VERSION == AD_VERSION1
static char *Trash = "\02\024Network Trash Folder";
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
static struct extmap *extmap = NULL, *defextmap = NULL;
#define VOLOPT_ALLOW 0 /* user allow list */
free(options[VOLOPT_DBPATH].c_value);
options[VOLOPT_DBPATH].c_value = strdup(val + 1);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
} else if (optionok(tmp, "mapchars:",val)) {
if (options[VOLOPT_MAPCHARS].c_value)
free(options[VOLOPT_MAPCHARS].c_value);
free(options[VOLOPT_FORCEGID].c_value);
options[VOLOPT_FORCEGID].c_value = strdup(val + 1);
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
} else if (val) {
/* ignore unknown options */
#ifdef __svr4__
volume->v_qfd = -1;
-#endif
+#endif /* __svr4__ */
volume->v_vid = lastvid++;
volume->v_lastdid = 3;
#if AD_VERSION > AD_VERSION1
if (options[VOLOPT_DBPATH].c_value)
volume->v_dbpath = strdup(options[VOLOPT_DBPATH].c_value);
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
#ifdef FORCE_UIDGID
volume->v_forcegid = NULL; /* set as null so as to return 0 later on */
}
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
}
u_int32_t maxsize;
#ifndef NO_QUOTA_SUPPORT
VolSpace qfree, qtotal;
-#endif
+#endif /* ! NO_QUOTA_SUPPORT */
spaceflag = AFPVOL_GVSMASK & vol->v_flags;
/* report up to 2GB if afp version is < 2.2 (4GB if not) */
goto getvolspace_done;
}
}
-#endif AFS
+#endif /* AFS */
if (( rc = ustatfs_getvolspace( vol, xbfree, xbtotal,
bsize)) != AFP_OK ) {
goto getvolspace_done;
}
}
-#endif
+#endif /* ! NO_QUOTA_SUPPORT */
vol->v_flags = ( ~AFPVOL_GVSMASK & vol->v_flags ) | AFPVOL_USTATFS;
getvolspace_done:
case VOLPBIT_ATTR :
#if AD_VERSION > AD_VERSION1
ashort = VOLPBIT_ATTR_FILEID;
-#else
+#else /* AD_VERSION > AD_VERSION1 */
ashort = 0;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
/* check for read-only.
* NOTE: we don't actually set the read-only flag unless
* it's passed in that way as it's possible to mount
xbfree = hton64( xbfree );
#if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
bcopy(&xbfree, data, sizeof(xbfree));
-#else
+#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
memcpy(data, &xbfree, sizeof( xbfree ));
-#endif
+#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
data += sizeof( xbfree );
break;
xbtotal = hton64( xbtotal );
#if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
bcopy(&xbtotal, data, sizeof(xbtotal));
-#else
+#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
memcpy(data, &xbtotal, sizeof( xbtotal ));
-#endif
+#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
data += sizeof( xbfree );
break;
-#endif
+#endif /* ! NO_LARGE_VOL_SUPPORT */
case VOLPBIT_NAME :
nameoff = data;
char *volname;
#if AD_VERSION == AD_VERSION1
char *p;
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
struct vol *volume;
struct dir *dir;
int len, ret, buflen;
*/
p = Trash;
cname( volume, volume->v_dir, &p );
-#endif
+#endif /* AD_VERSION == AD_VERSION1 */
return( AFP_OK );
#if AD_VERSION > AD_VERSION1
cnid_close(vol->v_db);
vol->v_db = NULL;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
return( AFP_OK );
}
/*
- * $Id: volume.h,v 1.4 2001-05-31 18:48:32 srittau Exp $
+ * $Id: volume.h,v 1.5 2001-06-20 18:33:04 rufustfirefly Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#if AD_VERSION > AD_VERSION1
void *v_db;
char *v_dbpath;
-#endif
+#endif /* AD_VERSION > AD_VERSION1 */
#ifdef FORCE_UIDGID
char *v_forceuid;
char *v_forcegid;
-#endif FORCE_UIDGID
+#endif /* FORCE_UIDGID */
};
#ifdef NO_LARGE_VOL_SUPPORT
typedef u_int32_t VolSpace;
-#else
+#else /* NO_LARGE_VOL_SUPPORT */
typedef u_int64_t VolSpace;
-#endif
+#endif /* NO_LARGE_VOL_SUPPORT */
#define AFPVOL_OPEN (1<<0)
#define AFPVOL_DT (1<<1)
extern int afp_setvolparams __P((AFPObj *, char *, int, char *, int *));
extern int afp_getsrvrparms __P((AFPObj *, char *, int, char *, int *));
extern int afp_closevol __P((AFPObj *, char *, int, char *, int *));
+
#endif
/*
- * $Id: util.h,v 1.2 2001-06-20 14:51:13 rufustfirefly Exp $
+ * $Id: util.h,v 1.3 2001-06-20 18:33:04 rufustfirefly Exp $
*/
#ifndef _ATALK_UTIL_H
#include <sys/cdefs.h>
#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
#include <netatalk/at.h>
extern unsigned const char _diacasemap[], _dialowermap[];
#define mod_error() ""
#else /* ! HAVE_DLFCN_H */
#include <dlfcn.h>
+
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif /* ! RTLD_NOW */
/*
- * $Id: module.c,v 1.3 2001-06-20 14:51:13 rufustfirefly Exp $
+ * $Id: module.c,v 1.4 2001-06-20 18:33:04 rufustfirefly Exp $
*/
#ifdef HAVE_CONFIG_H
#else /* HAVE_DLFCN_H */
-#ifdef DLSYM_PREPEND_UNDERSCORE
#include <dlfcn.h>
+#ifdef DLSYM_PREPEND_UNDERSCORE
void *mod_symbol(void *module, const char *name)
{
void *symbol;