Skip to content

Commit fc2f867

Browse files
committed
prot.c, prot.h: use gid_t and uid_t.
1 parent c3c65bc commit fc2f867

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/prot.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
#include "hasshsgr.h"
44
#include "prot.h"
55

6-
int prot_gid(int gid)
6+
#include <sys/types.h>
7+
#include <unistd.h>
8+
#include <grp.h>
9+
10+
int prot_gid(gid_t gid)
711
{
812
#ifdef HASSHORTSETGROUPS
913
short x[2];
@@ -15,7 +19,7 @@ int prot_gid(int gid)
1519
return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
1620
}
1721

18-
int prot_uid(int uid)
22+
int prot_uid(uid_t uid)
1923
{
2024
return setuid(uid);
2125
}

src/prot.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
#ifndef PROT_H
44
#define PROT_H
55

6-
extern int prot_gid(int);
7-
extern int prot_uid(int);
6+
#include <sys/types.h>
7+
8+
extern int prot_gid(gid_t);
9+
extern int prot_uid(uid_t);
810

911
#endif

0 commit comments

Comments
 (0)