Fixing a -G option bug in one of our patches

This commit is contained in:
Michal Ruprich 2020-07-22 12:00:01 +02:00
parent c632ae8e7b
commit eb41273215
2 changed files with 17 additions and 4 deletions

View File

@ -19,7 +19,7 @@ index f04a579..ca5cff2 100644
not 1,048,576 bytes).
+
+Note that when used with \fB\-Z\fR option (enabled by default), privileges
+are dropped before opening first savefile.
+are dropped before opening the first savefile.
.TP
.B \-d
Dump the compiled packet-matching code in a human readable form to
@ -34,6 +34,17 @@ index f04a579..ca5cff2 100644
.IP "\fI expression\fP"
.RS
selects which packets will be dumped.
@@ -366,6 +366,10 @@ If no time format is specified, each new file will overwrite the previous.
If used in conjunction with the
.B \-C
option, filenames will take the form of `\fIfile\fP<count>'.
+.IP
+Note that when used with
+.B \-Z
+option (enabled by default), privileges are dropped before opening the first savefile.
.TP
.B \-h
.PD 0
diff --git a/tcpdump.c b/tcpdump.c
index 73bf138..29f7f87 100644
--- a/tcpdump.c
@ -58,7 +69,7 @@ index 73bf138..29f7f87 100644
+ * user(default tcpdump) and drop root privileges.
+ */
+ if (WFileName)
+ if (Cflag && (username || chroot_dir))
+ if ((Cflag || Gflag) && (username || chroot_dir))
+ droproot(username, chroot_dir);
+ else
+ chown_flag = 1;
@ -91,4 +102,3 @@ index 73bf138..29f7f87 100644
* Only allow it to be restored if the -C or -G flag have been
--
2.9.3

View File

@ -2,7 +2,7 @@ Summary: A network traffic monitoring tool
Name: tcpdump
Epoch: 14
Version: 4.9.3
Release: 2%{?dist}
Release: 3%{?dist}
License: BSD with advertising
URL: http://www.tcpdump.org
Requires(pre): shadow-utils
@ -85,6 +85,9 @@ exit 0
%{_mandir}/man8/tcpdump.8*
%changelog
* Thu Jul 16 2020 Michal Ruprich <michalruprich@gmail.com> - 14:4.9.3-3
- Fixing a -G option bug in one of our patches
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 14:4.9.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild