[syslog-ng]-u and -g switches on syslog-ng 1.5.6
MURVAI-BUZOGANY Laszlo
Laszlo.MURVAI-BUZOGANY@gt-systems.hu
Mon, 14 May 2001 11:01:45 +0200
--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=ISO-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Hi!
I tried to run my newly-compiled syslog-ng-1.5.6 with different user and
group values than usually (root). As trying it, got segfault several times,
so after a short time I discovered some silly coding in src/main.c. In order
to make it work, only _really_ simple changes have to be made, I also made a
diff-file of the release and my (working) source. I attach it.
Hope I got the problem right, and didn't get messed up :)
sci
--
Murvai-Buzogány László Laszlo.Murvai-Buzogany@gt-systems.hu
--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="syslog-ng.diff"
--- syslog-ng-1.5.6/src/main.c Fri May 4 14:37:43 2001
+++ syslog-ng-1.5.6-mine/src/main.c Thu May 10 13:49:52 2001
@@ -232,7 +232,7 @@
group = strtok(NULL, "");
if (user) {
pw = getpwnam(user);
- if (!pw) {
+ if (pw) {
*uid = pw->pw_uid;
}
else {
@@ -247,7 +247,7 @@
if (group && gid) {
*gid = 0;
gr = getgrnam(group);
- if (!gr) {
+ if (gr) {
*gid = gr->gr_gid;
}
else {
@@ -265,7 +265,7 @@
*gid = 0;
gr = getgrnam(group);
- if (!gr) {
+ if (gr) {
*gid = gr->gr_gid;
}
else {
--XsQoSWH+UP9D9v3l--