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

Re: aide error



Why did you tag your message as spam?  I removed the tag.

latinfo@vcn.bc.ca wrote:
> Bob Proulx wrote:
> > Oh wow.  It is a data dependent problem!  The problem is that they
> > dynamically create aide configuration based upon the contents of /dev
> > which is variable dependent upon the devices and device labels and
> > other things that are attached to the system at that moment.
> >
> > And since that variable user data wasn't expected isn't any escaping
> > done.  So the result is user generated data input (such as unicode
> > disk labels) improperly quoted.  It will work fine on one system but
> > fail on another depending upon what is attached.
> 
> So well, this is the patch:
> ...
> It was not needed on Squeeze amd64 server!

It is data dependent.  Whether you need it or not depends.

> -  find /dev -path /dev/.static -prune -o -print | \
> -     sed -e 's/^\(.*\)/\1$ RamdiskData/'   \
> -         -e 's,\\,\\\\,g' -e 's,\.,\\\.,g' \
> -         -e 's,#,\\#,g'

There is the problem.  You can run that command manually to see what
output it produces.  It produces aide configuration that looks like
this:

  /dev$ RamdiskData
  /dev/md31$ RamdiskData
  /dev/md30$ RamdiskData
  ...
  /dev/disk/by-label$ RamdiskData
  /dev/disk/by-label/Debian\\x20testing\\x20amd64\\x201$ RamdiskData
  ...
  /dev/disk/by-id/dm-name-v1-frenzy$ RamdiskData
  /dev/disk/by-id/dm-name-v1-lcl$ RamdiskData
  /dev/disk/by-id/dm-name-v1-var$ RamdiskData
  /dev/disk/by-id/dm-name-v1-home$ RamdiskData
  /dev/disk/by-id/dm-name-v1-bak1$ RamdiskData
  ...
  /dev/disk/by-id/usb-Generic_USB_SM_Reader_058F312D81B-0:2$ RamdiskData
  /dev/disk/by-id/usb-Generic_USB_SM_Reader_058F312D81B-0:2$ RamdiskData
  ...
  /dev/disk/by-id/scsi-SATA_Hitachi_HDS7210_JP2911HQ1WGRMA-part6$ RamdiskData
  ...

As you can see there are names that are created by udev to match
things on the user's system.  In the above it is printing all of my
lvm partition names of which I only showed a few.  It is printing
everything that is attached to the usb bus.  It is printing everything
that is on SATA bus.  It is printing everything from the cdrom.  None
of the above is problematic.  But neither was I seeing any problem.

All it takes is for me to have one of those devices, a usb device or a
cdrom with a label where the label contents contain characters,
perhaps unicode characters, perhaps just unexpected content, and the
generated aide data file won't be correct.  The sed part was able to
protect some things but it isn't 100% general purpose.  It won't
handle some localization.  The resulting configuration file would be
problematic.  It would throw a syntax error.  As it was doing for you.

The patch removes that section from the aide default configuration.
It replaced it with:

  +  echo "/dev/\.static Full"
  +  echo "/dev RamdiskData"

That would certainly avoid the problem.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: