496 |
; |
; |
497 |
|
|
498 |
checkproc : CHECKPROC SERVICENAME PIDFILE PATH { |
checkproc : CHECKPROC SERVICENAME PIDFILE PATH { |
499 |
createservice(TYPE_PROCESS, $<string>2,$4); |
createservice(TYPE_PROCESS, $<string>2, $4); |
500 |
check_name($<string>2); |
check_name($<string>2); |
501 |
} |
} |
502 |
| CHECKPROC SERVICENAME PATHTOK PATH { |
| CHECKPROC SERVICENAME PATHTOK PATH { |
503 |
createservice(TYPE_PROCESS, $<string>2,$4); |
createservice(TYPE_PROCESS, $<string>2, $4); |
504 |
check_name($<string>2); |
check_name($<string>2); |
505 |
} |
} |
506 |
; |
; |
507 |
|
|
508 |
checkfile : CHECKFILE SERVICENAME PATHTOK PATH { |
checkfile : CHECKFILE SERVICENAME PATHTOK PATH { |
509 |
createservice(TYPE_FILE, $<string>2,$4); |
createservice(TYPE_FILE, $<string>2, $4); |
510 |
check_name($<string>2); |
check_name($<string>2); |
511 |
} |
} |
512 |
; |
; |
513 |
|
|
514 |
checkdev : CHECKDEV SERVICENAME PATHTOK PATH { |
checkdev : CHECKDEV SERVICENAME PATHTOK PATH { |
515 |
createservice(TYPE_DEVICE, $<string>2,$4); |
createservice(TYPE_DEVICE, $<string>2, $4); |
516 |
check_name($<string>2); |
check_name($<string>2); |
517 |
} |
} |
518 |
; |
; |
519 |
|
|
520 |
checkdir : CHECKDIR SERVICENAME PATHTOK PATH { |
checkdir : CHECKDIR SERVICENAME PATHTOK PATH { |
521 |
createservice(TYPE_DIRECTORY, $<string>2,$4); |
createservice(TYPE_DIRECTORY, $<string>2, $4); |
522 |
check_name($<string>2); |
check_name($<string>2); |
523 |
} |
} |
524 |
; |
; |
1391 |
struct passwd *r; |
struct passwd *r; |
1392 |
|
|
1393 |
if(user) { |
if(user) { |
1394 |
|
|
1395 |
#ifdef HAVE_GETPWNAM_R |
#ifdef HAVE_GETPWNAM_R |
1396 |
if((0 != getpwnam_r(user, &pwd, buf, 1024, &r)) || !r) { |
if((0 != getpwnam_r(user, &pwd, buf, 1024, &r)) || !r) { |
1397 |
#else |
#else |
1398 |
r = getpwnam(user); |
r = getpwnam(user); |
1399 |
if ( r == NULL ) { |
if ( r == NULL ) { |
1400 |
#endif |
#endif |
1401 |
|
|
1402 |
log("%s: Requested user '%s' not found on the system. Error at line %d\n", |
log("%s: Requested user '%s' not found on the system. Error at line %d\n", |
1403 |
prog, user, lineno); |
prog, user, lineno); |
1404 |
cfg_errflag++; |
cfg_errflag++; |
1405 |
|
|
1406 |
} |
} |
1407 |
|
|
1408 |
} else { |
} else { |
1409 |
|
|
1410 |
#ifdef HAVE_GETPWUID_R |
#ifdef HAVE_GETPWUID_R |
1411 |
if((0 != getpwuid_r(uid, &pwd, buf, 1024, &r)) || !r) { |
if((0 != getpwuid_r(uid, &pwd, buf, 1024, &r)) || !r) { |
1412 |
#else |
#else |
1413 |
r = getpwuid(uid); |
r = getpwuid(uid); |
1414 |
if ( r == NULL ) { |
if ( r == NULL ) { |
1415 |
#endif |
#endif |
1416 |
|
|
1417 |
log("%s: Requested uid '%d' not found on the system. Error at line %d\n", |
log("%s: Requested uid '%d' not found on the system. Error at line %d\n", |
1418 |
prog, uid, lineno); |
prog, uid, lineno); |
1419 |
cfg_errflag++; |
cfg_errflag++; |
1420 |
|
|
1421 |
} |
} |
1422 |
|
|
1423 |
} |
} |
1424 |
|
|
1425 |
if(r) { |
if(r) { |
|
|
|
1426 |
command->has_uid= TRUE; |
command->has_uid= TRUE; |
1427 |
command->uid= r->pw_uid; |
command->uid= r->pw_uid; |
1428 |
|
} |
1429 |
} |
|
|
|
|
1430 |
} else { |
} else { |
1431 |
|
|
1432 |
log("%s: Ignoring uid statement at line %d, not running as root.\n", |
log("%s: Ignoring uid statement at line %d, not running as root.\n", |
1433 |
prog, lineno); |
prog, lineno); |
1434 |
|
|
1435 |
} |
} |
1436 |
|
|
1437 |
} |
} |
1438 |
|
|
1439 |
|
|
1510 |
|
|
1511 |
if(IS(Run.logfile, logfile)) { |
if(IS(Run.logfile, logfile)) { |
1512 |
|
|
1513 |
|
free(logfile); |
1514 |
return; |
return; |
1515 |
|
|
1516 |
} else { |
} else { |
1534 |
|
|
1535 |
if(IS(Run.pidfile, pidfile)) { |
if(IS(Run.pidfile, pidfile)) { |
1536 |
|
|
1537 |
|
free(pidfile); |
1538 |
return; |
return; |
1539 |
|
|
1540 |
} else { |
} else { |
1560 |
|
|
1561 |
if(IS(Run.mailserver, mailserver)) { |
if(IS(Run.mailserver, mailserver)) { |
1562 |
|
|
1563 |
|
free(mailserver); |
1564 |
return; |
return; |
1565 |
|
|
1566 |
} else { |
} else { |
1586 |
|
|
1587 |
if(IS(Run.Auth.uname, uname)) { |
if(IS(Run.Auth.uname, uname)) { |
1588 |
|
|
1589 |
|
free(uname); |
1590 |
return; |
return; |
1591 |
|
|
1592 |
} else { |
} else { |