[Linux-cluster] Permissions in create_dlm_namespace() call ignored
Jeff
jeff at intersystems.com
Wed Aug 18 13:16:05 UTC 2004
Assuming that the named DLM namespace does not
already exist, the following code should
create a namespace which any process on the system
can open. However it doesn't work and subsequent
processes must be root or else the open_lockspace
call fails with
"Error opening dlm namespace: Permission denied"
dlm_lshandle_t dlmnamesp;
int i;
i = umask(0);
dlmnamesp = dlm_create_lockspace("play",0777);
/* S_IRWXU|S_IRWXG|S_IRWXO */
if (!dlmnamesp) {
dlmnamesp = dlm_open_lockspace("play");
if (!dlmnamesp) {
umask(i);
perror("Error opening dlm namespace");
exit(1);
}
}
umask(i);
if (dlm_ls_pthread_init(dlmnamesp)) {
perror("dlm_pthread_init failed");
exit(1);
}
[jeff at lx3 ~]$ ls -l /dev/misc
total 0
?--------- ? ? ? ? ? dlm-control
?--------- ? ? ? ? ? dlm_play
?--------- ? ? ? ? ? dlm_default
?--------- ? ? ? ? ? dlm_testls
[jeff at lx3 ~]$
More information about the Linux-cluster
mailing list