Page 1 of 1

umask 002

Posted: Thu Nov 19, 2009 6:53 am
by gregh-cctvsuppliers
Anyone know how to modify zoneminder such that the the making of the event folder is marked as umask 002.

In other words inherit the group permissions of the parent folder when making the directory.

In other words mkdir -m g=rw [next event number]

Posted: Thu Nov 19, 2009 7:52 pm
by timcraig
The creating of the directory is done in event.cpp. It looks like this:

Code: Select all

if ( mkdir( path, 0755 ) )
{
     Error( "Can't mkdir %s: %s", path, strerror(errno));
}
This part of the code starts at line# 135 in the latest version on the SVN.

To change the group permissions to rw, you'd want to change the 0755 in the 'mkdir' function call to 0765.

Worked

Posted: Fri Nov 20, 2009 3:51 am
by gregh-cctvsuppliers
That didn't work, I found a few more places in zm_monitor.cpp and zm_events.cpp and I changed those too. I'm running 24.2 version of zoneminder with FreeBSD 7.2

So I did sudo -u www umask and it said 0022

So I tried changing the umask inside of /etc/login.conf (I only had one uncommented umask, the rest were commented out) to 0 and running cap_mkdb /etc/login.conf and the problem still persisted.

Any chance you could point me in the right direction?

Nevermind

Posted: Fri Nov 20, 2009 5:52 am
by gregh-cctvsuppliers
Nevermind, I found it.

I modified umask to 2 in /root/.cshrc
and
added Defaults !umask in /usr/local/etc/sudoers

Thanks again.
Greg