Message ID | 200906221636.25006.zzam@gentoo.org (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-path: <linux-media-owner@vger.kernel.org> Envelope-to: mchehab@infradead.org Delivery-date: Mon, 22 Jun 2009 14:36:53 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for <mchehab@localhost> (single-drop); Mon, 22 Jun 2009 11:41:05 -0300 (BRT) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MIkdg-0006Aw-TF; Mon, 22 Jun 2009 14:36:53 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756959AbZFVOga (ORCPT <rfc822; kmpark@infradead.org> + 1 other); Mon, 22 Jun 2009 10:36:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756557AbZFVOg3 (ORCPT <rfc822;linux-media-outgoing>); Mon, 22 Jun 2009 10:36:29 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:47791 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756864AbZFVOg2 (ORCPT <rfc822;linux-media@vger.kernel.org>); Mon, 22 Jun 2009 10:36:28 -0400 Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 44A621C000B0 for <linux-media@vger.kernel.org>; Mon, 22 Jun 2009 16:36:31 +0200 (CEST) Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id 3F848903CD for <linux-media@vger.kernel.org>; Mon, 22 Jun 2009 16:36:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id SFjhWBT7ui4W for <linux-media@vger.kernel.org>; Mon, 22 Jun 2009 16:36:26 +0200 (CEST) Received: from gauss.x.fun (ppp-88-217-107-241.dynamic.mnet-online.de [88.217.107.241]) by mail.nefkom.net (Postfix) with ESMTP for <linux-media@vger.kernel.org>; Mon, 22 Jun 2009 16:36:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by gauss.x.fun (Postfix) with ESMTP id EE0001FC9AA for <linux-media@vger.kernel.org>; Mon, 22 Jun 2009 16:36:25 +0200 (CEST) From: Matthias Schwarzott <zzam@gentoo.org> To: linux-media@vger.kernel.org Subject: lsmod path hardcoded in v4l/Makefile Date: Mon, 22 Jun 2009 16:36:24 +0200 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_pb5PKLuGMmQpqz9" Message-Id: <200906221636.25006.zzam@gentoo.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Commit Message
Matthias Schwarzott
June 22, 2009, 2:36 p.m. UTC
Hi list!
It seems the path to lsmod tool is hardcoded in the Makefile for out-of-tree
building of v4l-dvb.
Now at least gentoo has moved lsmod from /sbin to /bin.
Additionally it is bad style (or at least I am told so), to not rely on $PATH
but hardcode pathes for tools that should be in $PATH.
So the attached patch removes the hardcoded /sbin from the lsmod call.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Regards
Matthias
Comments
On Dienstag, 23. Juni 2009, Andy Walls wrote: > On Mon, 2009-06-22 at 16:36 +0200, Matthias Schwarzott wrote: > > Hi list! > > > > It seems the path to lsmod tool is hardcoded in the Makefile for > > out-of-tree building of v4l-dvb. > > Now at least gentoo has moved lsmod from /sbin to /bin. > > Additionally it is bad style (or at least I am told so), to not rely on > > $PATH but hardcode pathes for tools that should be in $PATH. > > It's a potential security hole to rely on $PATH instead of absolute > paths when running a command as root. Shouldn't $PATH of root be considered safe? Else the distro or the system setup is doing something worse, and can't be improved by using fixed pathes in some scripts and Makefiles. Regards Matthias -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Dienstag, 23. Juni 2009, Theodore Kilgore wrote: > On Mon, 22 Jun 2009, Andy Walls wrote: > > On Mon, 2009-06-22 at 16:36 +0200, Matthias Schwarzott wrote: > >> Hi list! > >> > >> It seems the path to lsmod tool is hardcoded in the Makefile for > >> out-of-tree building of v4l-dvb. > >> Now at least gentoo has moved lsmod from /sbin to /bin. > > Sorry, but is it considered impertinent to ask why that lsmod should be > moved from /sbin (system binaries, and lsmod certainly is one of those) > and stick it into /bin instead? Is there any cogent reason for doing a /sbin are binaries that only root should use. But lsmod can be used by users, too. Suse also has only /bin/lsmod I think. I don't know too much about the reason for the move, but it was long ago - version 0.9.11 contained that move and was released around year 2003. Gentoo ebuild added /sbin/lsmod as compat symlink for things still hardcoding the path, but that was removed 2009 - 6 years should be enough. > thing like that, which may have escaped my attention? Unless one is making > some very small distro for some very small hardware and (say) one of /bin > and /sbin is symlinked to the other, I find a change like that to be > extremely puzzling. So, really. Why? For a real answer to "why", do ask module-init-tools maintainer. Regards Matthias -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 23 Jun 2009, Matthias Schwarzott wrote: > > On Mon, 2009-06-22 at 16:36 +0200, Matthias Schwarzott wrote: > > > It seems the path to lsmod tool is hardcoded in the Makefile for > > > out-of-tree building of v4l-dvb. > > > Shouldn't $PATH of root be considered safe? Else the distro or the system I believe make will set the variable whenever the makefile is used, even when building as non-root. It turns out that it was just lsmod with no path originally, but Michael Krufky changed it back in 2005 (commit b0e7b40744ef) to have a hardcoded path. Then later in commit c91e7f84a1d6 the only use of 'v4l_modules' was deleted, so we can just delete this line and not worry about sbin and paths. Mauro, Please pull from http://linuxtv.org/hg/~tap/fix for the following changeset: build: Remove module list cruft http://linuxtv.org/hg/~tap/fix?cmd=changeset;node=fb228bb1ad9f -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff -r 65ec132f20df v4l/Makefile --- a/v4l/Makefile Wed May 27 15:53:00 2009 -0300 +++ b/v4l/Makefile Thu May 28 10:05:04 2009 +0200 @@ -196,7 +196,7 @@ inst-m := $(obj-m) endif -v4l_modules := $(shell /sbin/lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) +v4l_modules := $(shell lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) ################################################# # locales seem to cause trouble sometimes.