From: Andrei Popescu on
On Jo, 29 iul 10, 08:38:00, Jordan Metzmeier wrote:
>
> For me it something that I just cringe to see. I realize that in
> practice, it is not bad. I just cannot get over feeling uneasy when
> seeing things like:
>
> find | grep
> cat | grep
> ls -l | grep
> for i in $(ls -l foo/)
> sudo su

add

dpkg -l | grep <packagename>

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
From: Boyd Stephen Smith Jr. on
On Thursday 29 July 2010 11:56:45 Eduardo M KALINOWSKI wrote:
> On Qui, 29 Jul 2010, "Boyd Stephen Smith Jr." wrote:
> > See my reply to Eduardo. In short, having (sudo su) available does not
> > mean that (sudo -i) will work.
>
> Well, if you wanna give a full root shell to someone, then do it in
> the correct way (allowing sudo -i to work), instead of allowing "su"
> via sudo.

I don't always have full control over /etc/sudoers, even if I have "root"
access. Therefore (sudo su) is a useful tool to have when (sudo -i) should,
but does not, work.

Like I said, (sudo su) is something to remember for when you are on a *mis-
configured* system.

(How many times do I have to say mis-configured before people stop assuming
*I* configure my systems that way!?)
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss(a)iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
From: Boyd Stephen Smith Jr. on
On Thursday 29 July 2010 11:51:55 Jordon Bedwell wrote:
> On 7/29/10 11:31 AM, Jordan Metzmeier wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > On 07/29/2010 12:22 PM, Boyd Stephen Smith Jr. wrote:
> >> I understand your issues with all but the last one. A user may need
> >> to "sudo su" due to configuration outside of their control. A system
> >> that requires you to "sudo su" for some task is likely misconfigured,
> >> but it is a useful tool to have around, as a user.
> >
> > I no longer configure my machines in a way that it allows a user to gain
> > full root via sudo. However, when I did, I found "sudo -i" to be more
> > appropriate than "sudo su" which seems to be more like "su -l". Of
> > course, you could always do "sudo su -l".
>
> I think the irony is still hitting from: "generally imply a limited,
> incomplete, or flawed understanding of one or more of the tools you are
> using"

Allowing a user to run (sudo su) requires them to have permissions to run the
command output by (which su) from their shell. Allowing a user to run (sudo -
i) requires them to have permissions to run the command output by (awk -F: '$1
== "root" { print $7; }' /etc/passwd | head -n 1). Allowing a user to run
(sudo -s) requires them to have permissions to run the command output by
(which $SHELL) from their shell. These three things are not always the same.
You may have permissions to do one or more of them and still be unable to give
yourself permissions to do all of them (think: SELinux).
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss(a)iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
From: Andrei Popescu on
On Jo, 29 iul 10, 13:59:29, Eduardo M KALINOWSKI wrote:
> On Qui, 29 Jul 2010, Andrei Popescu wrote:
> >add
> >
> >dpkg -l | grep <packagename>
>
> At least here (a somewhat old 8.04 Ubuntu), dpkg -l still requires grep:
>
> $ dpkg -l gnome
> No packages found matching gnome.

Of course, there is no package named 'gnome' ;)

> $ dpkg -l | grep gnome
> $ LANG=C dpkg -l | grep gnome
> ii bluez-gnome 0.25-0ubuntu1
> Bluetooth utilities for [... Several lines of packages]
> ii xulrunner-1.9-gnome-support
> 1.9.0.9+nobinonly-0ubuntu0.8.04.1 Support for
> Gnome in xulrunner-1.9 applications

,----[ dpkg-query(1) ]
| -l, --list package-name-pattern...
| List packages matching given pattern. If no package-name-pattern is
| given, list all packages in /var/lib/dpkg/status, excluding the
| ones marked as not-installed (i.e. those which have been previously
| purged). Normal shell wildchars are allowed in package-name-pat‐
| tern. Please note you will probably have to quote
| package-name-pattern to prevent the shell from performing filename
| expansion. For example this will list all package names starting with
| “libc6”:
|
| dpkg-query -l 'libc6*'
`----

(Note: 'dpkg -l' is short for 'dpkg-query -l')

Regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic