Skip to content

Commit

Permalink
reduce prot_uid() to a define
Browse files Browse the repository at this point in the history
  • Loading branch information
DerDakon committed Nov 15, 2022
1 parent 8f78935 commit 1fd3f91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ int prot_gids(const char *user, gid_t gid)

return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
}

int prot_uid(uid_t uid)
{
return setuid(uid);
}
3 changes: 2 additions & 1 deletion prot.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#define PROT_H

#include <sys/types.h>
#include <unistd.h>

extern int prot_gid(gid_t gid);
extern int prot_gids(const char *user, gid_t gid);
extern int prot_uid(uid_t uid);
#define prot_uid(uid) setuid(uid)

#endif

0 comments on commit 1fd3f91

Please sign in to comment.