Changeset 1221 for trunk/src/kash/setmode.c
- Timestamp:
- Oct 8, 2007, 1:15:00 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/setmode.c
r1218 r1221 51 51 #include <signal.h> 52 52 #include <stdlib.h> 53 #ifndef _MSC_VER 54 #include <unistd.h> 55 #else 56 #include "mscfakes.h" 57 #endif 53 #include "shinstance.h" /* for unistd.h types/defines */ 58 54 59 55 #ifdef SETMODE_DEBUG … … 89 85 #ifndef _DIAGASSERT 90 86 # define _DIAGASSERT assert 91 #endif 87 #endif 92 88 93 89 #ifndef S_ISTXT … … 106 102 */ 107 103 mode_t 108 getmode(bbox, omode) 109 const void *bbox; 110 mode_t omode; 104 bsd_getmode(const void *bbox, mode_t omode) 111 105 { 112 106 const BITCMD *set; … … 196 190 197 191 void * 198 setmode(p) 199 const char *p; 192 bsd_setmode(const char *p) 200 193 { 201 194 int perm, who; … … 221 214 sigfillset(&signset); 222 215 (void)sigprocmask(SIG_BLOCK, &signset, &sigoset); 223 #endif 216 #endif 224 217 (void)umask(mask = umask(0)); 225 218 mask = ~mask; … … 229 222 230 223 setlen = SET_LEN + 2; 231 224 232 225 if ((set = malloc((u_int)(sizeof(BITCMD) * setlen))) == NULL) 233 226 return (NULL); … … 290 283 case 's': 291 284 /* 292 * If specific bits where requested and 293 * only "other" bits ignore set-id. 285 * If specific bits where requested and 286 * only "other" bits ignore set-id. 294 287 */ 295 288 if (who == 0 || (who & ~S_IRWXO)) … … 298 291 case 't': 299 292 /* 300 * If specific bits where requested and 301 * only "other" bits ignore set-id. 293 * If specific bits where requested and 294 * only "other" bits ignore set-id. 302 295 */ 303 296 if (who == 0 || (who & ~S_IRWXO)) { … … 412 405 set->bits = mask; 413 406 } 414 407 415 408 if (oparg == '+') 416 409 set->cmd2 |= CMD2_SET; … … 446 439 * Given an array of bitcmd structures, compress by compacting consecutive 447 440 * '+', '-' and 'X' commands into at most 3 commands, one of each. The 'u', 448 * 'g' and 'o' commands continue to be separate. They could probably be 441 * 'g' and 'o' commands continue to be separate. They could probably be 449 442 * compacted, but it's not worth the effort. 450 443 */
Note:
See TracChangeset
for help on using the changeset viewer.