bug-findutils
[Top][All Lists]
Advanced

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

Re: findutils-4.1 /Solaris Largefile patch


From: Steve Revilak
Subject: Re: findutils-4.1 /Solaris Largefile patch
Date: Fri, 6 Jun 2003 08:45:13 -0400 (EDT)

> Date: Wed, 4 Jun 2003 09:09:32 +0200
> From: Stepan Kasal <address@hidden>
> To: Steve Revilak <address@hidden>
> Subject: Re: findutils-4.1 /Solaris Largefile patch
>
> Hello,
>
> On Tue, Jun 03, 2003 at 04:57:29PM -0400, Steve Revilak wrote:
> > I'd like to submit a patch to gnu find (from findutils-4.1) to help it
> > work better with largefiles on Solaris.
>
> a new development version of findutils has just been released.
> You can find it at
>       ftp://alpha.gnu.org/gnu/findutils/findutils-4.1.20.tar.gz
>
> The code you are patching has changed substantially.
>
> Would you be so kind to try the development version in your environment?
>
> Thank you very much for your feedback and patch,
>       Stepan Kasal


Stepan,

Thanks so much for the pointer.  So far, findutils-4.1.20 has been
working out very nicely.  I did find one small problem with the
updatedb script; when invoked with --netpaths=..., updatedb uses
`id -u' to determine the uid of the current user.
Not all id's understand -u (Solaris, for example).

I'd like to submit a small patch for this (below).

Thanks!

-- 
address@hidden


------------------------------------------------------------------
--- updatedb.sh.ORIG    2003-06-06 07:51:43.287337000 -0400
+++ updatedb.sh 2003-06-06 08:04:13.978416000 -0400
@@ -50,6 +50,12 @@
   esac
 done

+getuid() {
+    # uid=1(daemon) gid=1(other)
+    # for `id's that don't understand -u
+    id | sed 's/\(.*uid=\)\([0-9][0-9]*\)\(.*\)/\2/'
+}
+
 # You can set these in the environment, or use command-line options,
 # to override their defaults:

@@ -129,7 +135,8 @@
 fi

 if test -n "$NETPATHS"; then
-if [ "`id -u`" = 0 ]; then
+myuid=`getuid`
+if [ "$myuid" = 0 ]; then
     su $NETUSER -c \
      "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print"
   else
@@ -182,7 +189,8 @@
 fi

 if test -n "$NETPATHS"; then
-  if [ "`id -u`" = 0 ]; then
+  myuid=`getuid`
+  if [ "$myuid" = 0 ]; then
     su $NETUSER -c \
      "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print"
   else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]