catkin |
03-18-2012 10:29 AM |
Quote:
Originally Posted by unSpawn
(Post 4629727)
|
I didn't and thanks for pointing it out :)
But I'm confuzzled after reading it, probably because of differences between Red Hat and Slackware. The bug is about ownership of /var/lib/nfs/statd/sm. The patch modifies the RPM's postinstall script to change it to rpcuser:rpcuser/700 (the unpatched postinstall script sets /var/lib/nfs/statd to rpcuser:rpcuser).
The syslog message on Slackware is about /var/lib/nfs. There is no /var/lib/nfs/statd/sm directory on Slackware64 13.1:
Code:
root@CW8:/var/lib/nfs# tree -dgu
.
|-- [nobody root ] sm
|-- [nobody root ] sm.bak
`-- [root root ] v4recovery
This is identical to a fresh installation.
The Red Hat/Slackware difference is probably explained by Slackware's nfs-utils' file.c having NSM_PATH_EXTENSION commented out:
Code:
/*
* Some distributions place statd's files in a subdirectory
*/
#define NSM_PATH_EXTENSION
/* #define NSM_PATH_EXTENSION "/statd" */
#define NSM_DEFAULT_STATEDIR NFS_STATEDIR NSM_PATH_EXTENSION
static char nsm_base_dirname[PATH_MAX] = NSM_DEFAULT_STATEDIR;
#define NSM_MONITOR_DIR "sm"
#define NSM_NOTIFY_DIR "sm.bak"
#define NSM_STATE_FILE "state"
Slackware does not have the rpcuser or group.
The message comes from
Code:
/**
* nsm_drop_privileges - drop root privileges
* @pidfd: file descriptor of a pid file
*
* Returns true if successful, or false if some error occurred.
*
* Set our effective UID and GID to that of our on-disk database.
*/
_Bool
nsm_drop_privileges(const int pidfd)
{
struct stat st;
(void)umask(S_IRWXO);
/*
* XXX: If we can't stat dirname, or if dirname is owned by
* root, we should use "statduser" instead, which is set up
* by configure.ac. Nothing in nfs-utils seems to use
* "statduser," though.
*/
if (lstat(nsm_base_dirname, &st) == -1) {
xlog(L_ERROR, "Failed to stat %s: %m", nsm_base_dirname);
return false;
}
if (st.st_uid == 0) {
xlog_warn("Running as root. "
"chown %s to choose different user", nsm_base_dirname);
return true;
In conclusion, Slackware's equivalent of Red Hat's /var/lib/nfs/statd/sm is /var/lib/nfs/sm and Slackware uses nobody:root where Read Hat uses rpcuser:rpcuser.
Which leaves the practical question "What can be done on Slackware to make rcp.statd run as other than root?".
This has become Slackware-specific. I am reporting this thread, requesting moving it to the Slackware forum.
|