[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Update Manager absurdity?- (FOLLOW-UP)



On Fri, 2007-02-16 at 10:44 -0500, hendrik@topoi.pooq.com wrote:
> On Fri, Feb 16, 2007 at 10:06:56AM -0500, Celejar wrote:
> > On Fri, 16 Feb 2007 09:34:14 -0500
> > hendrik@topoi.pooq.com wrote:
> > 
> > [snip]
> > 
> > > > Speaking of learning, you shouldn't be running 'du' and 'dpkg -l' with
> > > > sudo; they'll run just fine as a normal user.
> > > 
> > > Won't they have a hard time with directories and files that are not 
> > > readable by the normal user?
> > 
> > No. dpkg just queries /var/lib/dpkg/status, which is world readable,
> > and 'du' works perfectly well on non-readable files:
> > 
> > ~$ cat /etc/shadow
> > cat: /etc/shadow: Permission denied
> > ~$ du /etc/shadow
> > 1       /etc/shadow
> 
> And does du also work with nonreadable directories?
> 
> -- hendrik
> 
> 

A quick test shows there are differences:

michael@ratty:/tmp$ du -sm /var
du: `/var/lib/gdm': Permission denied
du: `/var/lib/cups/certs': Permission denied
du: `/var/lib/amanda': Permission denied
du: `/var/cache/setup-tool-backends': Permission denied
du: `/var/log/exim4': Permission denied
du: `/var/log/samba': Permission denied
du: `/var/log/amanda': Permission denied
du: `/var/log/iptraf': Permission denied
du: `/var/run/exim4': Permission denied
du: `/var/run/sudo': Permission denied
du: `/var/spool/exim4': Permission denied
du: `/var/spool/cron/crontabs': Permission denied
du: `/var/spool/cron/atjobs': Permission denied
du: `/var/spool/cron/atspool': Permission denied
du: `/var/spool/cups': Permission denied
du: `/var/tmp/kdecache-michael/http/b': Permission denied
du: `/var/tmp/kdecache-root': Permission denied
4283    /var

michael@ratty:/tmp$ sudo du -sm /var
4288    /var





Reply to: