summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-07-05 06:55:29 +0000
committerguenther <guenther@openbsd.org>2014-07-05 06:55:29 +0000
commit6992a4ad38ac04f388c685da0c96970343c7870f (patch)
tree3206385e5fceb3479e4e7066f43a22db4186d549
parentAssume POSIX: uid_t and gid_t (diff)
downloadwireguard-openbsd-6992a4ad38ac04f388c685da0c96970343c7870f.tar.xz
wireguard-openbsd-6992a4ad38ac04f388c685da0c96970343c7870f.zip
Assume POSIX: uid_t and gid_t
-rw-r--r--usr.bin/rdist/client.c6
-rw-r--r--usr.bin/rdist/common.c14
-rw-r--r--usr.bin/rdist/defs.h8
-rw-r--r--usr.bin/rdist/os-openbsd.h18
4 files changed, 15 insertions, 31 deletions
diff --git a/usr.bin/rdist/client.c b/usr.bin/rdist/client.c
index ae4e5c0af73..2673884f50b 100644
--- a/usr.bin/rdist/client.c
+++ b/usr.bin/rdist/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.28 2014/07/05 06:45:00 guenther Exp $ */
+/* $OpenBSD: client.c,v 1.29 2014/07/05 06:55:29 guenther Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -976,7 +976,7 @@ update(char *rname, opt_t opts, struct stat *statp)
while (*owner && !isdigit((unsigned char)*owner) &&
(*owner != '-'))
++owner;
- if (owner && (UID_T) atoi(owner) != statp->st_uid) {
+ if (owner && (uid_t)atoi(owner) != statp->st_uid) {
debugmsg(DM_MISC,
"owner does not match (%d != %s).\n",
statp->st_uid, owner);
@@ -1002,7 +1002,7 @@ update(char *rname, opt_t opts, struct stat *statp)
while (*group && !isdigit((unsigned char) *group) &&
(*group != '-'))
++group;
- if (group && (UID_T) atoi(group) != statp->st_gid) {
+ if (group && (gid_t)atoi(group) != statp->st_gid) {
debugmsg(DM_MISC,
"group does not match (%d != %s).\n",
statp->st_gid, group);
diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c
index 719e2013f36..1e3acfb55cd 100644
--- a/usr.bin/rdist/common.c
+++ b/usr.bin/rdist/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.28 2014/07/05 06:18:58 guenther Exp $ */
+/* $OpenBSD: common.c,v 1.29 2014/07/05 06:55:29 guenther Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -45,8 +45,8 @@
* Variables common to both client and server
*/
char host[MAXHOSTNAMELEN]; /* Name of this host */
-UID_T userid = (UID_T)-1; /* User's UID */
-GID_T groupid = (GID_T)-1; /* User's GID */
+uid_t userid = (uid_t)-1; /* User's UID */
+gid_t groupid = (gid_t)-1; /* User's GID */
char *homedir = NULL; /* User's $HOME */
char *locuser = NULL; /* Local User's name */
int isserver = FALSE; /* We're the server */
@@ -430,10 +430,10 @@ readrem(char *p, ssize_t space)
* Get the user name for the uid.
*/
char *
-getusername(UID_T uid, char *file, opt_t opts)
+getusername(uid_t uid, char *file, opt_t opts)
{
static char buf[100];
- static UID_T lastuid = (UID_T)-1;
+ static uid_t lastuid = (uid_t)-1;
struct passwd *pwd = NULL;
/*
@@ -472,10 +472,10 @@ getusername(UID_T uid, char *file, opt_t opts)
* Get the group name for the gid.
*/
char *
-getgroupname(GID_T gid, char *file, opt_t opts)
+getgroupname(gid_t gid, char *file, opt_t opts)
{
static char buf[100];
- static GID_T lastgid = (GID_T)-1;
+ static gid_t lastgid = (gid_t)-1;
struct group *grp = NULL;
/*
diff --git a/usr.bin/rdist/defs.h b/usr.bin/rdist/defs.h
index 4e03a189d1d..c588ce0f4fe 100644
--- a/usr.bin/rdist/defs.h
+++ b/usr.bin/rdist/defs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: defs.h,v 1.21 2014/07/05 06:18:58 guenther Exp $ */
+/* $OpenBSD: defs.h,v 1.22 2014/07/05 06:55:29 guenther Exp $ */
#ifndef __DEFS_H__
#define __DEFS_H__
@@ -302,7 +302,7 @@ extern int rem_r; /* Remote file descriptor, reading */
extern int rem_w; /* Remote file descriptor, writing */
extern int rtimeout; /* Response time out in seconds */
extern int setjmp_ok; /* setjmp/longjmp flag */
-extern UID_T userid; /* User ID of rdist user */
+extern uid_t userid; /* User ID of rdist user */
extern jmp_buf finish_jmpbuf; /* Setjmp buffer for finish() */
extern struct group *gr; /* pointer to static area used by getgrent */
extern struct linkbuf *ihead; /* list of files with more than one link */
@@ -342,8 +342,8 @@ void sighandler(int);
int sendcmd(char, const char *, ...) __attribute__((__format__ (printf, 2, 3)));
int remline(u_char *, int, int);
ssize_t readrem(char *, ssize_t);
-char *getusername(UID_T, char *, opt_t);
-char *getgroupname(GID_T, char *, opt_t);
+char *getusername(uid_t, char *, opt_t);
+char *getgroupname(gid_t, char *, opt_t);
int response(void);
char *exptilde(char *, char *, size_t);
int becomeuser(void);
diff --git a/usr.bin/rdist/os-openbsd.h b/usr.bin/rdist/os-openbsd.h
index c119b62b455..4346b4c773b 100644
--- a/usr.bin/rdist/os-openbsd.h
+++ b/usr.bin/rdist/os-openbsd.h
@@ -29,7 +29,7 @@
*/
/*
- * $OpenBSD: os-openbsd.h,v 1.17 2014/07/05 06:45:00 guenther Exp $
+ * $OpenBSD: os-openbsd.h,v 1.18 2014/07/05 06:55:29 guenther Exp $
*/
/*
@@ -66,22 +66,6 @@
#define HAVE_FSTYPENAME 1
/*
- * UID argument type for chown()
- */
-typedef uid_t CHOWN_UID_T;
-
-/*
- * GID argument type for chown()
- */
-typedef gid_t CHOWN_GID_T;
-
-/*
- * Our types, usually these are uid_t and gid_t.
- */
-typedef uid_t UID_T; /* Must be signed */
-typedef gid_t GID_T; /* Must be signed */
-
-/*
* Generic pointer, used by memcpy, malloc, etc. Usually char or void.
*/
typedef void POINTER;