/*
- * $Id: auth.c,v 1.70 2009-11-22 11:52:38 franklahm Exp $
+ * $Id: auth.c,v 1.71 2009-11-30 15:30:47 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include "status.h"
#include "fork.h"
#include "extattrs.h"
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
#include "acls.h"
#endif
afp_switch = postauth_switch;
switch (afp_version) {
case 32:
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
uam_afpserver_action(AFP_GETACL, UAM_AFPSERVER_POSTAUTH, afp_getacl, NULL);
uam_afpserver_action(AFP_SETACL, UAM_AFPSERVER_POSTAUTH, afp_setacl, NULL);
uam_afpserver_action(AFP_ACCESS, UAM_AFPSERVER_POSTAUTH, afp_access, NULL);
-#endif
+#endif /* HAVE_ACLS */
uam_afpserver_action(AFP_GETEXTATTR, UAM_AFPSERVER_POSTAUTH, afp_getextattr, NULL);
uam_afpserver_action(AFP_SETEXTATTR, UAM_AFPSERVER_POSTAUTH, afp_setextattr, NULL);
uam_afpserver_action(AFP_REMOVEATTR, UAM_AFPSERVER_POSTAUTH, afp_remextattr, NULL);
}
#endif /* TRU64 */
- /* There's probably a better way to do this, but for now, we just
- play root */
+ if (ngroups > 0) {
+ #define GROUPSTR_BUFSIZE 1024
+ char groupsstr[GROUPSTR_BUFSIZE];
+ char *s = groupsstr;
+ int j = GROUPSTR_BUFSIZE;
+
+ int n = snprintf(groupsstr, GROUPSTR_BUFSIZE, "%u", groups[0]);
+ j -= n;
+ s += n;
+
+ for (int i = 1; i < ngroups; i++) {
+ n = snprintf(s, j, ", %u", groups[i]);
+ if (n == j) {
+ /* Buffer full */
+ LOG(log_debug, logtype_afpd, "login: group string buffer overflow");
+ break;
+ }
+ j -= n;
+ s += n;
+ }
+ LOG(log_debug, logtype_afpd, "login: %u supplementary groups: %s", ngroups, groupsstr);
+ }
+ /* There's probably a better way to do this, but for now, we just play root */
#ifdef ADMIN_GRP
- if (admin) uuid = 0;
+ if (admin)
+ uuid = 0;
else
#endif /* ADMIN_GRP */
uuid = pwd->pw_uid;
*rbuflen += sizeof(id);
}
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
if (bitmap & USERIBIT_UUID) {
int ret;
- uuid_t uuid;
+ atalk_uuid_t uuid;
char *uuidstring;
if ( ! (obj->options.flags & OPTION_UUID))
rbuf += UUID_BINSIZE;
*rbuflen += UUID_BINSIZE;
}
-#endif
+#endif /* HAVE_ACLS */
LOG(log_debug, logtype_afpd, "END afp_getuserinfo:");
return AFP_OK;