Hi,
alsa-driver has a slight error in its Makefile.
The line in question is this here:
install -m 644 -g root -o root $f /usr/include/sound
Obviously it uses a specific name “root”, rather than the
number 0.
On systems which do not have a superuser name called root,
this will produce such an error:
install: invalid user `root’
Now, it is trivial to fix it (use numbers instead of fixed
names like “root”, because the numbers always work. To
reproduce sometimes odd behaviour you could alias root
to another name, like in:
usermod -l new_name root
)
But - since I am using ruby scripts for fetching source and
compiling it already, i wondered if there was a way to completely
control processes like the above.
In other words, my “watchguard” script would first check if a
command is valid, before it tries to execute it (or feed to make,
or some other binary).
In the above example it would simply change:
install -m 644 -g root -o root $f /usr/include/sound
to
install -m 644 -g 0 -o 0 $f /usr/include/sound
This seems like a trivial thing to do, although I have no
real idea how to do this at all.
PS: I already have a somewhat buggyruby script which actually
fixes incorrect Makefiles, but I thought that a ruby script
which can actually sanitize the input “on-the-fly” and correct
mistakes would be smarter and more powerful. So I am at
least in theory curious how to approach this problem.