[tcpdump/f19] savefile: don't try to change ownership of stdout
Michal Sekletar
msekleta at fedoraproject.org
Mon Oct 7 15:42:04 UTC 2013
commit f3b5ddb3f2c9fb36fa123aebf26962455c5c3804
Author: Michal Sekletar <msekleta at redhat.com>
Date: Mon Oct 7 15:40:31 2013 +0200
savefile: don't try to change ownership of stdout
I case we already opened savefile we want to change ownership of the file to the
given user (tcpdump by default), but we shouldn't do so when dumping to stdout
is requested.
Resolves: #1015767
Conflicts:
tcpdump.spec
tcpdump-4.4.0-eperm.patch | 8 ++++----
tcpdump.spec | 5 ++++-
2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/tcpdump-4.4.0-eperm.patch b/tcpdump-4.4.0-eperm.patch
index e96dbbe..5750a8a 100644
--- a/tcpdump-4.4.0-eperm.patch
+++ b/tcpdump-4.4.0-eperm.patch
@@ -1,6 +1,6 @@
diff -up tcpdump-4.4.0/tcpdump.1.in.eperm tcpdump-4.4.0/tcpdump.1.in
---- tcpdump-4.4.0/tcpdump.1.in.eperm 2013-05-06 13:24:27.832436506 +0200
-+++ tcpdump-4.4.0/tcpdump.1.in 2013-05-06 13:24:27.839436511 +0200
+--- tcpdump-4.4.0/tcpdump.1.in.eperm 2013-10-07 15:21:26.795602764 +0200
++++ tcpdump-4.4.0/tcpdump.1.in 2013-10-07 15:21:26.800602762 +0200
@@ -221,6 +221,9 @@ have the name specified with the
flag, with a number after it, starting at 1 and continuing upward.
The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes,
@@ -24,7 +24,7 @@ diff -up tcpdump-4.4.0/tcpdump.1.in.eperm tcpdump-4.4.0/tcpdump.1.in
selects which packets will be dumped.
diff -up tcpdump-4.4.0/tcpdump.c.eperm tcpdump-4.4.0/tcpdump.c
--- tcpdump-4.4.0/tcpdump.c.eperm 2013-03-24 22:49:18.000000000 +0100
-+++ tcpdump-4.4.0/tcpdump.c 2013-05-06 13:28:40.929602618 +0200
++++ tcpdump-4.4.0/tcpdump.c 2013-10-07 15:22:26.360590143 +0200
@@ -1426,11 +1426,24 @@ main(int argc, char **argv)
}
#endif /* HAVE_CAP_NG_H */
@@ -66,7 +66,7 @@ diff -up tcpdump-4.4.0/tcpdump.c.eperm tcpdump-4.4.0/tcpdump.c
+ if (!pwd)
+ error("Couldn't find user '%s'", username);
+
-+ if (chown(dumpinfo.CurrentFileName, pwd->pw_uid, pwd->pw_gid) < 0)
++ if (strcmp(WFileName, "-") && chown(dumpinfo.CurrentFileName, pwd->pw_uid, pwd->pw_gid) < 0)
+ error("Couldn't change ownership of savefile");
+
+ if (username || chroot_dir)
diff --git a/tcpdump.spec b/tcpdump.spec
index e45114b..d9e89b1 100644
--- a/tcpdump.spec
+++ b/tcpdump.spec
@@ -2,7 +2,7 @@ Summary: A network traffic monitoring tool
Name: tcpdump
Epoch: 14
Version: 4.4.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: BSD with advertising
URL: http://www.tcpdump.org
Group: Applications/Internet
@@ -95,6 +95,9 @@ exit 0
%{_mandir}/man8/tcpdump.8*
%changelog
+* Mon Oct 7 2013 Michal Sekletar <msekleta at redhat.com> - 14:4.4.0-2
+- don't try to change ownership of stdout (#1015767)
+
* Thu Jun 06 2013 Michal Sekletar <msekleta at redhat.com> - 14:4.4.0-1
- update to 4.4.0
More information about the scm-commits
mailing list