~ubuntu-branches/ubuntu/intrepid/djbdns/intrepid-updates

« back to all changes in this revision

Viewing changes to prot.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape
  • Date: 2008-03-02 23:22:04 UTC
  • Revision ID: james.westby@ubuntu.com-20080302232204-wa3owprcpeiyu8kj
Tags: upstream-1.05
ImportĀ upstreamĀ versionĀ 1.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "hasshsgr.h"
 
2
#include "prot.h"
 
3
 
 
4
int prot_gid(int gid)
 
5
{
 
6
#ifdef HASSHORTSETGROUPS
 
7
  short x[2];
 
8
  x[0] = gid; x[1] = 73; /* catch errors */
 
9
  if (setgroups(1,x) == -1) return -1;
 
10
#else
 
11
  if (setgroups(1,&gid) == -1) return -1;
 
12
#endif
 
13
  return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
 
14
}
 
15
 
 
16
int prot_uid(int uid)
 
17
{
 
18
  return setuid(uid);
 
19
}