[dhcp-agent-commits] dhcp-agent/src dhcp-client.c,1.18,1.19 dhcp-files.c,1.7,1.8
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2002-12-29 05:17:52
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv6637 Modified Files: dhcp-client.c dhcp-files.c Log Message: fixed file_permissions_are() Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** dhcp-client.c 29 Dec 2002 05:09:55 -0000 1.18 --- dhcp-client.c 29 Dec 2002 05:17:49 -0000 1.19 *************** *** 348,354 **** if(mkdir(work_dir, S_IRWXU) < 0) { FATAL_MESSAGE("cannot create work directory", strerror(errno)); - } else if(!file_permissions_are(work_dir, S_IRWXU)) { - FATAL_MESSAGE("wrong permissions on work directory: %s (use rwx only for owner)", work_dir); } } --- 348,356 ---- if(mkdir(work_dir, S_IRWXU) < 0) { FATAL_MESSAGE("cannot create work directory", strerror(errno)); } + } + + if(!file_permissions_are(work_dir, S_IRWXU)) { + FATAL_MESSAGE("wrong permissions on work directory: %s (use rwx only for owner)", work_dir); } Index: dhcp-files.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-files.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dhcp-files.c 23 Dec 2002 01:21:52 -0000 1.7 --- dhcp-files.c 29 Dec 2002 05:17:49 -0000 1.8 *************** *** 116,123 **** ERROR_MESSAGE("could not stat file %s", fname); return -1; ! } else if(st.st_mode != mode) ! return 0; /* mode matches. */ else ! return 1; /* mode does not match. */ } --- 116,125 ---- ERROR_MESSAGE("could not stat file %s", fname); return -1; ! } ! ! if((st.st_mode&(S_IRWXU|S_IRWXG|S_IRWXO)) == mode) ! return 1; /* mode matches. */ else ! return 0; /* mode does not match. */ } |