blob: 5d928fbab5c60c64bacf710817d529ab489f3e46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
$NetBSD: patch-ak,v 1.4 2001/04/23 15:06:17 abs Exp $
--- faxd/UUCPLock.c++.orig Thu Sep 21 10:24:54 2000
+++ faxd/UUCPLock.c++
@@ -37,6 +37,7 @@
}
#endif
#include <pwd.h>
+#include <grp.h>
/*
* UUCP Device Locking Support.
@@ -146,8 +147,13 @@
if (!pwd)
faxApp::fatal("Can not deduce identity of UUCP");
UUCPuid = pwd->pw_uid;
- UUCPgid = pwd->pw_gid;
endpwent(); // paranoia
+
+ const group *grp = getgrnam(FAX_GROUP);
+ if (!grp)
+ faxApp::fatal("Can not deduce group identity of '" FAX_GROUP "'");
+ UUCPgid = grp->gr_gid;
+ endgrent(); // paranoia
}
}
uid_t UUCPLock::getUUCPUid() { setupIDs(); return UUCPuid; }
|