bug-bash
[Top][All Lists]
Advanced

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

Can't get the set-user-id bit to work


From: Sebastian Tennant
Subject: Can't get the set-user-id bit to work
Date: Tue, 27 Dec 2005 16:55:17 +0000
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi all,

If it's a festive time of year where you are then I hope you're
enjoying it.

First of all, apologies if this is not the correct list for this
query.  Perhaps you could suggest where else I should go.

I have a 3-line script; foo:

  #!/bin/bash
  id -u         # EUID
  id -u -r      # `real' UID

Here's it's directory listing:

  -rwsrwxr--   1 root   adm  1317 Dec 27 16:18 foo

I set these permissions with the command:

  $ sudo chmod 4774 foo

Here's what I get if I run foo as myself (UID 1000):

  $ ./foo
  1000
  1000

Surely this should be:

  $ ./foo
  0
  1000

... or am I missing the point somehow?


I started to investigate the behaviour of the set-user-id bit because
of another problem I've been experiencing for some time:

A cron.daily script handles mandb.  I elected to install it with the
set-user-id bit set, as you can see:

  /usr/lib/man-db:
  used 220 available 573264
  drwxr-xr-x    2 root root  4096 Oct 16 15:13 .
  drwxr-xr-x  116 root root 24576 Dec 14 11:49 ..
  -rwsr-xr-x    1 man  root 86932 Sep 21 13:23 man
  -rwsr-xr-x    1 man  root 96808 Sep 21 13:23 mandb

Every day I receive the same message in my inbox:

  /etc/cron.daily/man-db script:
  mandb: can't create a temporary filename: Permission denied

mandb is a binary executable file so I have no idea where it is trying
to create the temporary file, but it certianly shouldn't have any
trouble creating it in /tmp:

  drwxrwxr-x  13 root root 4096 Dec 27 16:50 /tmp

Any help with either of these issues is very much appreciated.

sdt

--
GNU bash, version 3.1.0(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.





reply via email to

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