209
209
const char *file, size_t len,
210
210
size_t *pos, size_t *lineno)
211
211
__attribute__ ((warn_unused_result));
212
static int stanza_setuid (JobClass *class, NihConfigStanza *stanza,
213
const char *file, size_t len,
214
size_t *pos, size_t *lineno)
215
__attribute__ ((warn_unused_result));
216
static int stanza_setgid (JobClass *class, NihConfigStanza *stanza,
217
const char *file, size_t len,
218
size_t *pos, size_t *lineno)
219
__attribute__ ((warn_unused_result));
212
220
static int stanza_debug (JobClass *class, NihConfigStanza *stanza,
213
221
const char *file, size_t len,
214
222
size_t *pos, size_t *lineno)
253
261
{ "limit", (NihConfigHandler)stanza_limit },
254
262
{ "chroot", (NihConfigHandler)stanza_chroot },
255
263
{ "chdir", (NihConfigHandler)stanza_chdir },
264
{ "setuid", (NihConfigHandler)stanza_setuid },
265
{ "setgid", (NihConfigHandler)stanza_setgid },
256
266
{ "debug", (NihConfigHandler)stanza_debug },
257
267
{ "manual", (NihConfigHandler)stanza_manual },
2535
2545
return nih_config_skip_comment (file, len, pos, lineno);
2550
* @class: job class being parsed,
2551
* @stanza: stanza found,
2552
* @file: file or string to parse,
2553
* @len: length of @file,
2554
* @pos: offset within @file,
2555
* @lineno: line number.
2557
* Parse a setuid stanza from @file, extracting a single argument
2558
* containing a user name.
2560
* Returns: zero on success, negative value on error.
2563
stanza_setuid (JobClass *class,
2564
NihConfigStanza *stanza,
2570
nih_assert (class != NULL);
2571
nih_assert (stanza != NULL);
2572
nih_assert (file != NULL);
2573
nih_assert (pos != NULL);
2576
nih_unref (class->setuid, class);
2578
class->setuid = nih_config_next_arg (class, file, len, pos, lineno);
2579
if (! class->setuid)
2582
return nih_config_skip_comment (file, len, pos, lineno);
2587
* @class: job class being parsed,
2588
* @stanza: stanza found,
2589
* @file: file or string to parse,
2590
* @len: length of @file,
2591
* @pos: offset within @file,
2592
* @lineno: line number.
2594
* Parse a setgid stanza from @file, extracting a single argument
2595
* containing a group name.
2597
* Returns: zero on success, negative value on error.
2600
stanza_setgid (JobClass *class,
2601
NihConfigStanza *stanza,
2607
nih_assert (class != NULL);
2608
nih_assert (stanza != NULL);
2609
nih_assert (file != NULL);
2610
nih_assert (pos != NULL);
2613
nih_unref (class->setgid, class);
2615
class->setgid = nih_config_next_arg (class, file, len, pos, lineno);
2616
if (! class->setgid)
2619
return nih_config_skip_comment (file, len, pos, lineno);