summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorrees <rees@FreeBSD.org>2004-02-21 21:02:59 +0000
committerrees <rees@FreeBSD.org>2004-02-21 21:02:59 +0000
commitd68e8ba04cb070f349043edccaafae5facffab48 (patch)
treedd5d060bef7e25b7d791dbccd3fdaa5edf9c2fad /sbin
parentfcf7e634fb12f16e5d5a0b3ee3cfafda001a303c (diff)
downloadFreeBSD-src-d68e8ba04cb070f349043edccaafae5facffab48.zip
FreeBSD-src-d68e8ba04cb070f349043edccaafae5facffab48.tar.gz
change baduser and badgroup from -2 to 65534, 65533
these should probably be looked up instead, but this is better than before also minor format changes for style(9)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/idmapd/idmapd.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/sbin/idmapd/idmapd.c b/sbin/idmapd/idmapd.c
index 8dccd15..809f7b4 100644
--- a/sbin/idmapd/idmapd.c
+++ b/sbin/idmapd/idmapd.c
@@ -32,10 +32,12 @@
#include <sys/syscall.h>
#include <sys/errno.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
+#include <nfs4client/nfs4_dev.h>
+#include <nfs4client/nfs4_idmap.h>
+
#include <stdio.h>
#include <fcntl.h>
#include <assert.h>
@@ -45,22 +47,16 @@
#include <pwd.h>
#include <grp.h>
-#include <nfs4client/nfs4_dev.h>
-#include <nfs4client/nfs4_idmap.h>
-
-/* #include "idmap.h" */
-
#define DEV_PATH "/dev/nfs4"
-#define DOMAIN "@FreeBSD.org"
-#define BADUSER "nobody"
+#define DOMAIN "@FreeBSD.org"
+#define BADUSER "nobody"
#define BADGROUP "nogroup"
-#define BADUID (-2)
-#define BADGID (-2)
+#define BADUID 65534
+#define BADGID 65533
struct idmap_e {
struct nfs4dev_msg msg;
-
TAILQ_ENTRY(idmap_e) next;
};
@@ -243,7 +239,7 @@ idmap_service(struct idmap_e * e)
if (pwd == NULL) {
fprintf(stderr, "unknown uid %d!\n",
- (uint32_t)m->id_id.uid);
+ (uint32_t)m->id_id.uid);
name = BADUSER;
} else
name = pwd->pw_name;
@@ -271,7 +267,7 @@ idmap_service(struct idmap_e * e)
if (idmap_id(m, id))
return -1;
}
- break;
+ break;
case IDMAP_TYPE_GID:
if (m->id_namelen == 0) {
/* id to name */
@@ -279,7 +275,7 @@ idmap_service(struct idmap_e * e)
if (grp == NULL) {
fprintf(stderr, "unknown gid %d!\n",
- (uint32_t)m->id_id.gid);
+ (uint32_t)m->id_id.gid);
name = BADGROUP;
} else
name = grp->gr_name;
@@ -290,7 +286,7 @@ idmap_service(struct idmap_e * e)
/* name to id */
name = idmap_prune_domain(m);
if (name == NULL)
- return -1;
+ return -1;
grp = getgrnam(name);
@@ -306,11 +302,11 @@ idmap_service(struct idmap_e * e)
if (idmap_id(m, id))
return -1;
}
- break;
+ break;
default:
fprintf(stderr, "bad idmap type: %d\n", m->id_type);
return -1;
- break;
+ break;
}
return 0;
OpenPOWER on IntegriCloud