umask 002

Forum for questions and support relating to the 1.24.x releases only.
Locked
gregh-cctvsuppliers
Posts: 17
Joined: Tue Sep 29, 2009 11:19 pm

umask 002

Post 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]
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

Post 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.
gregh-cctvsuppliers
Posts: 17
Joined: Tue Sep 29, 2009 11:19 pm

Worked

Post 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?
gregh-cctvsuppliers
Posts: 17
Joined: Tue Sep 29, 2009 11:19 pm

Nevermind

Post 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
Locked