Skip to contentSkip to conversation

No Locate for User

DISCUSSION Peter H. 4 participants 14 messages Apr 25, 2005 – Apr 26, 2005

lore
Share & tools
lore

Peter H.

author
#0 lore raw

Hi,

Slackware 10.1 kernel 2.4.29

I upgraded again Dropline Gnome from 2.8.3 to 2.10 this time with no problems regarding certain programs like gxine not opening.

However, I cannot use the command "locate" as a user any longer. I get the following error:

@~:$ locate fips
warning: locate: could not open database: /var/lib/slocate/slocate.db: 
Permission denied

As su there is no problem.

I did not do anything to this file in fact it has the same permissions as in my Fedora box where a user can do "locate" w/o problem just like before the upgrade in slack. Updateddb is done daily by cron root.

:# ls -l /var/lib/slocate
total 4176
-rw-r----- 1 root slocate 4275159 2005-04-24 18:06 slocate.db

How to resolve?

Thanks & regards

Signature · 7 lines
Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#1 lore raw
Quoted 13 lines · Peter H.

Hi,

Slackware 10.1 kernel 2.4.29

I upgraded again Dropline Gnome from 2.8.3 to 2.10 this time with no problems regarding certain programs like gxine not opening.

However, I cannot use the command "locate" as a user any longer. I get the following error:

@~:$ locate fips
warning: locate: could not open database: /var/lib/slocate/slocate.db: Permission denied

As su there is no problem.

Quoted 7 lines

I did not do anything to this file in fact it has the same permissions as in my Fedora box where a user can do "locate" w/o problem just like before the upgrade in slack. Updateddb is done daily by cron root.

:# ls -l /var/lib/slocate
total 4176
-rw-r----- 1 root slocate 4275159 2005-04-24 18:06 slocate.db

How to resolve?

I don't know why ... that is, how ... your Fedora host works with these permissions, but I'm not surprised that your Slackware host presents problems with them. On Debian, the corresponding file (in a different location, but the functional equivalent) is mode 644, the mode you'd expect for a file that is to be readable by all users:

 ray@kuryakin:~$ ls -l /var/cache/locate/locatedb
 -rw-r--r--  1 root root 1089123 Apr 24 06:25 /var/cache/locate/locatedb

So try changing the mode to 644 with chmod. Or try adding all users who need to use locate to the group slocate (in /etc/group ... perhaps Fedora uses this trick to make locate work in mode 640?).

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

author
#2 lore raw
Quoted 6 lines · On Sun, 24 Apr 2005 22:06:04 -0700 Ray Olszewski <[email protected]> wrote:
Quoted 5 lines · Peter H.

Hi,

Slackware 10.1 kernel 2.4.29

I upgraded again Dropline Gnome from 2.8.3 to 2.10 this time with no

problems

Quoted 6 lines
Quoted 6 lines

regarding certain programs like gxine not opening.

However, I cannot use the command "locate" as a user any longer. I get the

following error:

Quoted 7 lines
Quoted 7 lines
@~:$ locate fips
warning: locate: could not open database: /var/lib/slocate/slocate.db: 
Permission denied

As su there is no problem.

I did not do anything to this file in fact it has the same permissions as

in

Quoted 1 line
Quoted 1 line

my Fedora box where a user can do "locate" w/o problem just like before

the

Quoted 15 lines
Quoted 7 lines

upgrade in slack. Updateddb is done daily by cron root.

:# ls -l /var/lib/slocate
total 4176
-rw-r----- 1 root slocate 4275159 2005-04-24 18:06 slocate.db

How to resolve?

I don't know why ... that is, how ... your Fedora host works with these permissions, but I'm not surprised that your Slackware host presents problems with them. On Debian, the corresponding file (in a different location, but the functional equivalent) is mode 644, the mode you'd expect for a file that is to be readable by all users:

Quoted 7 lines
  ray@kuryakin:~$ ls -l /var/cache/locate/locatedb
  -rw-r--r--  1 root root 1089123 Apr 24 06:25 /var/cache/locate/locatedb

So try changing the mode to 644 with chmod. Or try adding all users who need to use locate to the group slocate (in /etc/group ... perhaps Fedora uses this trick to make locate work in mode 640?).

Since I am using Linux beginning with ReaHat 5.1 then later switching to slackware I always used "locate" as user and never bothered to look at the permission of /var/lib/slocate since there was obviously no need.

Before I posted this mail I tried various permission for slocate even my user name as owner and get the same error: Permission denied.

That's why I am at a loss. I checked the dropline forum and could not find a reference. Might have to post one.

Regards

Peter

Signature · 6 lines
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#3 lore raw

Peter wrote:
[...]

Quoted 11 lines
Quoted 7 lines

I don't know why ... that is, how ... your Fedora host works with these permissions, but I'm not surprised that your Slackware host presents problems with them. On Debian, the corresponding file (in a different location, but the functional equivalent) is mode 644, the mode you'd expect for a file that is to be readable by all users:

 ray@kuryakin:~$ ls -l /var/cache/locate/locatedb
 -rw-r--r--  1 root root 1089123 Apr 24 06:25 /var/cache/locate/locatedb

So try changing the mode to 644 with chmod. Or try adding all users who need to use locate to the group slocate (in /etc/group ... perhaps Fedora uses this trick to make locate work in mode 640?).

Since I am using Linux beginning with ReaHat 5.1 then later switching to slackware I always used "locate" as user and never bothered to look at the permission of /var/lib/slocate since there was obviously no need.

Quoted 5 lines

Before I posted this mail I tried various permission for slocate even my user name as owner and get the same error: Permission denied.

That's why I am at a loss. I checked the dropline forum and could not find a reference. Might have to post one.

It is always difficult to give advice in response to an incomplete problem description. I suggested changing the mode because you did not mention having done so in your first report. From what you just wrote this time ("I tried various permission for slocate"), I *still* cannot tell if you tried what I actually suggested -- using chmod to set the database file (slocate.db) to mode 644.

Also, I am unclear as to what you tried changing the mode of. The issue is NOT with the directory "/var/lib/slocate". It is with the file "/var/lib/slocate/slocate.db". Since you say you tried things with "slocate" rather than "slocate.db", I am uncertain as to which of the two you were modifying.

So ... I suggest you try running (as root) this specific command:

chmod 644 /var/lib/slocate/slocate.db

Then run "ls -l /var/lib/slocate/slocate.db" to make sure the change took effect.

Then, as an ordinary user, attempt to run the "locate" command and see if the error persists.

If it does not, this is your fix. (Though you may need to confirm that a run of "updatedb" preserves the 644 permissions.)

If it does, then round up the usual suspects:

ls -l /var/lib/slocate/slocate.db
ls -l /usr/bin/locate (or wherever Slackware puts it) ldd /usr/bin/locate

And, as you did before, quote the actual command you ran and the actual, exact error message you got.

See if the Dropline install affected any of the libs identified by the second command. (You'll recall at the time of your first problem my expressing skepticism that someone on the Dropline list could assure you that xmms was the "only" app affected ... ANY change to libc6 can be far-reaching.)

Also check "ls -l /usr/bin/locate" on the Fedora host ... I'm still curious as to how it manages to use mode 640, so I (and you) want to see if it is doing something with the suid or sgid bit that the Slackware version is no longer doing.

(BTW, can some Slackware user here with a working locate command run "ls -l /usr/bin/locate" and "ls -l /var/lib/slocate/slocate.db" and post the results, so Peter can see what a working Slackware system is *supposed* to look like?)

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

author
#4 lore raw

Sorry for not expressing myself clearly!

Quoted 3 lines · [email protected] said:

From what you just wrote this time ("I tried various permission for
slocate"), I *still* cannot tell if you tried what I actually suggested -- using chmod to set the database file (slocate.db) to mode 644.

Yes I did chmod 644 /var/lib/slocate/slocate.db and it changed nothing.

Quoted 2 lines · [email protected] said:

Since you say you tried things with "slocate" rather than "slocate.db", I am uncertain as to which of the two you were modifying.

I did all the changes on slocate.db. I even made myself the owner. Even then I get Permission denied.

Updatedb changes permissions of slocate.db back to -rw-r----- 1 root slocate.

Quoted 4 lines · [email protected] said:

If it does, then round up the usual suspects:
ls -l /var/lib/slocate/slocate.db
ls -l /usr/bin/locate (or wherever Slackware puts it) ldd /usr/bin/locate

ls -l /var/lib/slocate/slocate.db
-rw-r--r-- 1 root slocate 6640136 2005-04-25 18:08 /var/lib/slocate/slocate.db

ls -l /usr/bin/locate
lrwxrwxrwx 1 root root 7 2005-03-08 17:45 /usr/bin/locate -> slocate

ldd /usr/bin/slocate
libc.so.6 => /lib/libc.so.6 (0x4001e000)
/lib/ld-linux.so.2 (0x80000000)

Fedora:
ls -l /var/lib/slocate/slocate.db -rw-r----- 1 root slocate 2874826 2005-04-20 15:07 /mnt/rh9root/var/lib/slocate/slocate.db

ls -l /usr/bin/locate
-rwxr-sr-x 1 root slocate 26460 2004-10-20 /usr/bin/locate -> slocate

ldd /usr/bin/slocate

        libc.so.6 => /lib/tls/libc.so.6 (0x004c7000)
        /lib/ld-linux.so.2 (0x004ae000)

In Fedora libc-2.3.3.so in slackware libc-2.3.4.so

In Fedora /bin/locate is root:slocate in slackware root:root. I changed it to root:slocate and still get Permission denied.

Quoted 2 lines · [email protected] said:

See if the Dropline install affected any of the libs identified by the second command.

libc-2.3.4.so is the one from the install CD.

 @~:$ /mnt/rh9root/usr/bin/locate fips
warning: locate: could not open database: /var/lib/slocate/slocate.db: 
Permission denied
warning: You need to run the 'updatedb' command (as root) to create the 
database.

With this additional warning using the Fedora locate could it mean slocate.db is not found by the user? this warning one gets if a new distro had been installed or the data base had not been updated for some time.

To double check I booted into Fedora and "locate" run by user works as it has always done as it did in slackware before I updated dropline.

Regards

Signature · 9 lines
Peter



-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#5 lore raw

I suspect you'll simply need to do:

chmod 2755 $(which slocate)
chown root:slocate $(which slocate)
(which is probably the same as)

chmod 2755 /usr/bin/slocate
chown root:slocate /usr/bin/slocate

slocate considers the db file to be sensitive (as well it should). the slocate binary needs to run as the slocate group to use it.

Quoted 4 lines
 @~:$ /mnt/rh9root/usr/bin/locate fips
warning: locate: could not open database: /var/lib/slocate/slocate.db: Permission denied
warning: You need to run the 'updatedb' command (as root) to create the database.

Um. This could be due to many things. Perhaps the partition is mounted nosuid, and slocate isn't running with the right permissions. Perhaps you've got a different version of slocate on fedora than slackware. Running a binary from one version against data from another shouldn't be expected to work. 'chroot /mnt/rh9root locate fips' ought to work fine.

have fun,

greg
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

author
#6 lore raw

Thanks Greg but nothing doing.

ll /usr/bin/slocate
-rwxr-sr-x 1 root slocate 26652 2004-05-30 11:52 /usr/bin/slocate

@~:$ locate fips
warning: locate: could not open database: /var/lib/slocate/slocate.db: 
Permission denied
Quoted 1 line · [email protected] said:

'chroot /mnt/rh9root locate fips' ought to work fine.

Yes as su and that is exactly what I want to avoid to go su for locate since I use this command relatively frequently.

Regards

Signature · 7 lines
Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#7 lore raw
Quoted 5 lines · Peter

Thanks Greg but nothing doing.

ll /usr/bin/slocate
-rwxr-sr-x 1 root slocate 26652 2004-05-30 11:52 /usr/bin/slocate

/usr is mounted *without* nosuid, no?

"cat /proc/mounts | grep '/usr'"
and
"cat /proc/mounts | grep ' / '"

Quoted 3 lines
@~:$ locate fips
warning: locate: could not open database: /var/lib/slocate/slocate.db: Permission denied

grr. Frustrating.
what does 'ls -ld /var/lib/slocate' say?

does 'chmod 750 /var/lib/slocate/' or 'chown root:slocate /var/lib/slocate' help (if it isn't rwxr-x--- root slocate already)?

If not, what does 'slocate -V' say?

How about
'ls -ld /var'
'ls -ld /var/lib'
also?

Thanks a bunch. Apologies if you've posted this output before and I missed it.

Quoted 7 lines
Quoted 1 line · [email protected] said:

'chroot /mnt/rh9root locate fips' ought to work fine.

Yes as su and that is exactly what I want to avoid to go su for locate since I use this command relatively frequently.

totally understood. I was just trying to point out that it is unlikely for the redhat slocate binary to work with the slackware data files.

hope this helps,

-greg
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

author
#8 lore raw
Quoted 1 line · On Tue, 26 Apr 2005 00:44:42 -0700 Greg Olszewski <[email protected]> wrote:

/usr is mounted *without* nosuid, no?

/usr is 755 and not mounted separately.

Quoted 2 lines

"cat /proc/mounts | grep '/usr'"

cat /proc/mounts | grep '/usr'
/dev/hda9 /usr/local reiserfs rw 0 0

Quoted 2 lines

and
"cat /proc/mounts | grep ' / '"

cat /proc/mounts | grep ' / '
rootfs / rootfs rw 0 0 /dev/root / reiserfs rw 0 0

Quoted 1 line

what does 'ls -ld /var/lib/slocate' say?

drwxr-x--- 2 heisspf root 80 2005-04-26 11:42 /var/lib/slocate

Quoted 2 lines

does 'chmod 750 /var/lib/slocate/' or 'chown root:slocate /var/lib/slocate' help (if it isn't rwxr-x--- root slocate already)?

ls -l /var/lib/slocate/
total 4180
-rw-r----- 1 root slocate 4278159 2005-04-26 11:42 slocate.db

ls -ld /var/lib/slocate
drwxr-x--- 2 heisspf root 80 2005-04-26 11:42 /var/lib/slocate

No
Yes it is

Quoted 2 lines

If not, what does 'slocate -V' say?

Secure Locate 2.7 - Released January 24, 2003

Quoted 2 lines

How about
'ls -ld /var'

drwxr-x--- 2 heisspf root 80 2005-04-26 11:42 /var/lib/slocate

In /etc/group
slocate:x:21:users
I added users

Quoted 1 line

'ls -ld /var/lib'

drwx------ 24 root users 608 2005-03-21 09:43 /var/lib

---snip---

Quoted 2 lines

-greg

Permission is still denied.

Thanks

Signature · 6 lines
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#9 lore raw
Quoted 3 lines · Peter

drwxr-x--- 2 heisspf root 80 2005-04-26 11:42 /var/lib/slocate

ought to root:slocate (although current might be just fine) see below.

Quoted 5 lines

ls -l /var/lib/slocate/
total 4180
-rw-r----- 1 root slocate 4278159 2005-04-26 11:42 slocate.db

should be fine.

Quoted 3 lines

ls -ld /var/lib/slocate
drwxr-x--- 2 heisspf root 80 2005-04-26 11:42 /var/lib/slocate

see above.

Quoted 6 lines
Quoted 2 lines

If not, what does 'slocate -V' say?

Secure Locate 2.7 - Released January 24, 2003

Well, that makes me worry less. Same version and date that I'm experimenting with.

Quoted 7 lines
Quoted 3 lines

How about
'ls -ld /var'

drwxr-x--- 2 heisspf root 80 2005-04-26 11:42 /var/lib/slocate

that's not /var, it's /var/lib/slocate. No worries. for /var root:users or root:root 755 should be fine. /var/lib/slocate ought to be root:slocate 750. see above.

Quoted 4 lines

In /etc/group
slocate:x:21:users
I added users

That's not going to help. The last field is a list of users, not groups. It should be a moot point though, although it would be safer to remove it (in case some software doesn't handle a unlookable user name (users)).

Quoted 6 lines
Quoted 2 lines

'ls -ld /var/lib'

drwx------ 24 root users 608 2005-03-21 09:43 /var/lib

There it is!

slocate can't get to /var/lib/slocate at all. It doesn't have permission to get to /var/lib, so it can't even see /var/lib/slocate.

my /var/lib is 0755 root:root

So I believe the following commands ought to make slocate happy (without breaking anything else (hope))

either
chmod 755 /var/lib (more likely to work)
or
chmod 750 /var/lib (more paranoid)

chmod 755 /var (just in case)

chown root:slocate /var/lib/slocate
chmod 750 /var/lib/slocate

chmod 2775 /usr/bin/slocate
chown root:slocate /usr/bin/slocate

that ought to put your machine in a working (and relatively correct ) state. Hope I didn't miss anything.

hope this helps,

greg
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

author
#10 lore raw

Un grande embrazzo.

chown root:root /var/lib

@~:$ locate fips

I closed my eyes.
I opened my eyes.

/usr/bin/openssl_fips_fingerprint
/usr/include/openssl/fips_rand.h
/usr/include/openssl/fips.h

By golly that was a hard one.

Thanks a lot!

Signature · 7 lines
Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#11 lore raw
In reply to Peter
Quoted 50 lines · Peter

Sorry for not expressing myself clearly!

Quoted 5 lines · [email protected] said:

From what you just wrote this time ("I tried various permission for slocate"), I *still* cannot tell if you tried what I actually suggested -- using chmod to set the database file (slocate.db) to mode 644.

Yes I did chmod 644 /var/lib/slocate/slocate.db and it changed nothing.

Quoted 4 lines · [email protected] said:

Since you say you tried things with "slocate" rather than "slocate.db", I am uncertain as to which of the two you were modifying.

I did all the changes on slocate.db. I even made myself the owner. Even then I get Permission denied.

Updatedb changes permissions of slocate.db back to -rw-r----- 1 root slocate.

Quoted 6 lines · [email protected] said:

If it does, then round up the usual suspects:
ls -l /var/lib/slocate/slocate.db
ls -l /usr/bin/locate (or wherever Slackware puts it) ldd /usr/bin/locate

ls -l /var/lib/slocate/slocate.db
-rw-r--r-- 1 root slocate 6640136 2005-04-25 18:08 /var/lib/slocate/slocate.db

ls -l /usr/bin/locate
lrwxrwxrwx 1 root root 7 2005-03-08 17:45 /usr/bin/locate -> slocate

ldd /usr/bin/slocate
libc.so.6 => /lib/libc.so.6 (0x4001e000)
/lib/ld-linux.so.2 (0x80000000)

Fedora:
ls -l /var/lib/slocate/slocate.db -rw-r----- 1 root slocate 2874826 2005-04-20 15:07 /mnt/rh9root/var/lib/slocate/slocate.db

Quoted 8 lines

ls -l /usr/bin/locate
-rwxr-sr-x 1 root slocate 26460 2004-10-20 /usr/bin/locate -> slocate

ldd /usr/bin/slocate

       libc.so.6 => /lib/tls/libc.so.6 (0x004c7000)
       /lib/ld-linux.so.2 (0x004ae000)

.../tls/... ?

My Slackware 10.1: ldd /usr/bin/slocate:
libc.so.6 => /lib/libc.so.6 (0x40009000)
/lib/ld-linux.so.2 (0x80000000)

HTH, Chuck

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#12 lore raw
In reply to Ray Olszewski
Quoted 2 lines · Ray Olszewski

<snip>
(BTW, can some Slackware user here with a working locate command run "ls -l /usr/bin/locate" and "ls -l /var/lib/slocate/slocate.db" and post the results, so Peter can see what a working Slackware system is *supposed* to look like?)

I am not subscribed under this account so I'll privately post to Ray and Peter. HTH, Chuck

Slackware 10.1.0

#ls -l /usr/bin/locate
lrwxrwxrwx 1 root root 7 2005-03-21 12:32 /usr/bin/locate -> slocate*

#ls -l /usr/bin/slocate
-rwxr-sr-x 1 root slocate 26652 2004-05-29 23:52 slocate*

#ls -l /var/lib/slocate/slocate*
-rw-r----- 1 root slocate 7890114 2005-04-26 04:42 /var/lib/slocate/slocate.db

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

author
#13 lore raw
In reply to Ray Olszewski
Quoted 3 lines · [email protected] said:

Or try adding all users who need to use locate to the group slocate (in /
etc/group ... perhaps Fedora uses this trick to make locate work in mode 640?).

Fedora: /etc/group/slocate:x:21

Slackware: /etc/group/slocate::21

I added user /etc/group/slocate::21:user

Same: Permission denied

Regards

Signature · 7 lines
Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs