Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 115447 - cyrus user can't be used via su
Summary: cyrus user can't be used via su
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-13 12:13 UTC by Paul Oldham
Modified: 2006-07-18 21:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Oldham 2005-12-13 12:13:24 UTC
In order to do some management tasks with cyrus, e.g. 'reconstruct', you must be 
user cyrus. The normal way to do this is to do "su cyrus" while logged in as 
root. However this doesn't work as the cyrus user (created by this package I'm 
assuming) isn't set up for this. I had to add an entry to /etc/shadow, and 
change /bin/false to /bin/bash in /etc/passwd before I could do this.

Reproducible: Always
Steps to Reproduce:
1. Log in as root, do "su cyrus". You get

   su: Authentication service cannot retrieve authentication info.

2. Add an entry to /etc/shadow (copy the nobody line replacing "nobody" with
   "cyrus") and this goes away but you still can't succeed in changing to be
   user cyrus.

3. Update the cyrus entry in /etc/passwd replacing "false" with "bash"

Actual Results:  
Having done the above you can now do "su cyrus" from root and run things like 
'reconstruct'


Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.
14-gentoo-r2 i686)
=================================================================
System uname: 2.6.14-gentoo-r2 i686 AMD Sempron(tm) Processor 2600+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/
config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo-distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://mirror.bytemark.co.uk/gentoo"
USE="x86 apache2 apm arts avi berkdb bitmap-fonts bzip2 crypt cups eds emboss 
encode expat foomaticdb fortran gdbm gif gpm gstreamer gtk2 imlib ipv6 jpeg ldap 
libg++ libwww mad mhash mikmod motif mp3 mpeg mysql ncurses nls ogg oggvorbis 
opengl oss pam pcre pdflib perl png python quicktime readline sdl spell ssl tcpd 
truetype-fonts type1-fonts udev vorbis xml2 xmms xv zlib userland_GNU 
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, 
PORTDIR_OVERLAY
Comment 1 Tuan Van (RETIRED) gentoo-dev 2006-07-18 21:36:16 UTC
from the su(1)
SYNOPSIS
       su [options] [-] [username [ args ]]
...
OPTIONS
...
       -s, --shell SHELL
          The shell that will be invoked.

          The invoked shell is choosen among (higest priority first):

          o  The shell specified with --shell

          o  If --preserve-environment is used, the shell specified by the
             $SHELL environment variable.

          o  The shell indicated in the /etc/passwd entry for the target user.

          o   /bin/sh if a shell could not be found by any above method.
...
so you can do 
su -s /bin/sh username "command --options" WFM. For exmaple:
su -s /bin/sh cyrus -c "/usr/lib/cyrus/squatter -r user.joe@example.com" to create indexes for user Joe mailbox.

Sorry for the late response.

HTH
Tuan