Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Nov 1996 12:41:41 +0100 (MET)
From:      Mikael Karpberg <karpen@ocean.campus.luth.se>
To:        clary@elec.uq.edu.au (Clary Harridge)
Cc:        freebsd-security@FreeBSD.org
Subject:   Re: /etc/security
Message-ID:  <199611011141.MAA08439@ocean.campus.luth.se>
In-Reply-To: <199610302332.JAA21364@s5.elec.uq.edu.au> from Clary Harridge at "Oct 31, 96 09:32:18 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Hello!

According to Clary Harridge:
> A suggestion for /etc/security
> 
> The current version falls over when checking for suid / sgid files
> when the file names contain spaces. These file names are generated
> by win95 when your FreeBSD host runs as a samba server.
> Any such suid files just get dropped by the find but give errors.
> 
> You get lots of errors like
> 
> find: /u1/staff/matt/Mail/ GPutland: illegal path
> find: /u1/staff/matt/Mail/ Email: illegal path

Yeah, I've seen this too, because I have some filenames with spaces...
----

According to Garrett Wollman:
> <<On Thu, 31 Oct 1996 08:18:58 +0100, sthaug@nethelp.no said:
[... on the find job not handling ' characters either ...]
> >> checking setuid files and devices:
> >> find: /doscopy/sb16/pro_org/i'vebeen.org: illegal path
> >> find: /doscopy/sb16/pro_org/she'llbe.org: illegal path
> 
> The best way to deal with this is probably using the `-print0' primary
> to `find' and using a `perl -n0' script to process the results, like:
> 
> 	find ..... -print0 | perl -n0e 'exec "/bin/ls", "-lFgod", <>;'

Would this solve the spaces problem too, and any other eventualities?

----

According to Nathan Lawson:
> > 	find ..... -print0 | perl -n0e 'exec "/bin/ls", "-lFgod", <>;'
> 
> Yes, the -print0 option is useful, but to avoid executing another interpreter
> just for the task of filtering out the NULLs, I prefer to use xargs -0
> 
> >From the man page:
>      -0      Changes xargs to expect NUL (``\0'') characters as seperators,
>              instead of spaces and newlines.  This is expected to be used in
>              concert with the -print0 function in find.
> 
> This avoids execing a costly interpreter and keeps the scripts using xargs,
> which is useful with very long path lists.

Sounds good... if you can avoid using perl there it's nice...

----

According to Marc Slemko:
> > >From the man page:
> >      -0      Changes xargs to expect NUL (``\0'') characters as seperators,
> >              instead of spaces and newlines.  This is expected to be used in
> >              concert with the -print0 function in find.
> > 
> > This avoids execing a costly interpreter and keeps the scripts using xargs,
> > which is useful with very long path lists.
> 
> Except for the minor problem that xargs does not have a -0 option
> on FreeBSD.  GNU xargs does and OpenBSD xargs does.  Below is the
> diff from OpenBSD to implement the change.  I think it is a worthwhile
> change, although I haven't really looked too much at the OpenBSD
> way of doing it to see if it is a good implementation.
[...patch deleted...]

Is there anything speaking against this being added?
And the change in /etc/security taking place?
I for one would really like to see the scan handle all legal filenames.
Speaking of which... Is the /tmp cleaning job also errnous in that it will
not handle all names? Any other scripts in etc which have the same error?

   /Mikael





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611011141.MAA08439>