Skip to content

Commit

Permalink
Remove the "Force UID/GID" feature, GitHub #516
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Oct 18, 2023
1 parent d8e71a2 commit b5d296d
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 288 deletions.
17 changes: 0 additions & 17 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -260,23 +260,6 @@ AC_ARG_ENABLE(debugging,
AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
AC_CHECK_ICONV

netatalk_cv_force_uidgid=no
AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
AC_ARG_ENABLE(force-uidgid,
[ --enable-force-uidgid allow forcing of uid/gid per volume (BROKEN) ],[
if test "$enableval" = "yes"; then
AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
AC_MSG_RESULT([enabling forcing of uid/gid per volume])
AC_MSG_RESULT([yes])
netatalk_cv_force_uidgid=yes
else
AC_MSG_RESULT([no])
fi
],[
AC_MSG_RESULT([no])
]
)

dnl Check for CNID database backends
bdb_required=no
AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
Expand Down
3 changes: 1 addition & 2 deletions etc/afpd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ afpd_SOURCES = \
status.c \
switch.c \
uam.c \
uid.c \
unix.c \
volume.c

Expand Down Expand Up @@ -72,7 +71,7 @@ endif

noinst_HEADERS = auth.h afp_config.h desktop.h directory.h fce_api_internal.h file.h \
filedir.h fork.h icon.h mangle.h misc.h status.h switch.h \
uam_auth.h uid.h unix.h volume.h hash.h acls.h acl_mappings.h extattrs.h \
uam_auth.h unix.h volume.h hash.h acls.h acl_mappings.h extattrs.h \
dircache.h afp_zeroconf.h afp_avahi.h afp_mdns.h

hash_SOURCES = hash.c
Expand Down
15 changes: 0 additions & 15 deletions etc/afpd/afp_asp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@
#include "fork.h"
#include "dircache.h"

#ifdef FORCE_UIDGID
#warning UIDGID
#include "uid.h"
#endif /* FORCE_UIDGID */

static AFPObj *child;

static void afp_authprint_remove(AFPObj *);
Expand Down Expand Up @@ -347,11 +342,6 @@ void afp_over_asp(AFPObj *obj)
reply = (*afp_switch[ func ])(obj,
asp->commands, asp->cmdlen,
asp->data, &asp->datalen);
#ifdef FORCE_UIDGID
/* bring everything back to old euid, egid */
if (obj->force_uid)
restore_uidgid ( &obj->uidgid );
#endif /* FORCE_UIDGID */
} else {
LOG(log_error, logtype_afpd, "bad function %X", func );
asp->datalen = 0;
Expand Down Expand Up @@ -382,11 +372,6 @@ void afp_over_asp(AFPObj *obj)
reply = (*afp_switch[ func ])(obj,
asp->commands, asp->cmdlen,
asp->data, &asp->datalen);
#ifdef FORCE_UIDGID
/* bring everything back to old euid, egid */
if (obj->force_uid)
restore_uidgid ( &obj->uidgid );
#endif /* FORCE_UIDGID */
} else {
LOG(log_error, logtype_afpd, "(write) bad function %X", func );
asp->datalen = 0;
Expand Down
15 changes: 0 additions & 15 deletions etc/afpd/afp_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
#include "fork.h"
#include "dircache.h"

#ifdef FORCE_UIDGID
#warning UIDGID
#include "uid.h"
#endif /* FORCE_UIDGID */

#ifndef SOL_TCP
#define SOL_TCP IPPROTO_TCP
#endif
Expand Down Expand Up @@ -636,11 +631,6 @@ void afp_over_dsi(AFPObj *obj)

dir_free_invalid_q();

#ifdef FORCE_UIDGID
/* bring everything back to old euid, egid */
if (obj->force_uid)
restore_uidgid ( &obj->uidgid );
#endif /* FORCE_UIDGID */
dsi->flags &= ~DSI_RUNNING;

/* Add result to the AFP replay cache */
Expand Down Expand Up @@ -681,11 +671,6 @@ void afp_over_dsi(AFPObj *obj)
AfpNum2name(function), AfpErr2name(err));

dsi->flags &= ~DSI_RUNNING;
#ifdef FORCE_UIDGID
/* bring everything back to old euid, egid */
if (obj->force_uid)
restore_uidgid ( &obj->uidgid );
#endif /* FORCE_UIDGID */
} else {
LOG(log_error, logtype_afpd, "(write) bad function %x", function);
dsi->datalen = 0;
Expand Down
6 changes: 0 additions & 6 deletions etc/afpd/afp_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,12 +609,6 @@ static void show_version_extended(void )
puts( "No" );
#endif

printf( " Force volume uid/gid:\t" );
#ifdef FORCE_UIDGID
puts( "Yes" );
#else
puts( "No" );
#endif

printf( " EA support:\t" );
puts( EA_MODULES );
Expand Down
5 changes: 0 additions & 5 deletions etc/afpd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,6 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi
obj->uid = geteuid();
obj->logout = logout;

#ifdef FORCE_UIDGID
obj->force_uid = 1;
save_uidgid ( &obj->uidgid );
#endif

/* pam_umask or similar might have changed our umask */
(void)umask(obj->options.umask);

Expand Down
3 changes: 0 additions & 3 deletions etc/afpd/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,9 +1317,6 @@ int afp_copyfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, si
goto copy_exit;
}

#ifdef FORCE_UIDGID
/* FIXME svid != dvid && dvid's user can't read svid */
#endif
if (NULL == ( d_vol = getvolbyvid( dvid )) ) {
retvalue = AFPERR_PARAM;
goto copy_exit;
Expand Down
140 changes: 0 additions & 140 deletions etc/afpd/uid.c

This file was deleted.

25 changes: 0 additions & 25 deletions etc/afpd/uid.h

This file was deleted.

0 comments on commit b5d296d

Please sign in to comment.