-
Notifications
You must be signed in to change notification settings - Fork 0
/
swb_file.c
55 lines (44 loc) · 921 Bytes
/
swb_file.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* udd swb_file.c file - switchboard's file routines
*
* 03-Sep-89, Chuck Cranor
*
* V5.1C (see VERSION file for history)
*
*/
#include <unistd.h>
#include <stdio.h>
#include "defs.h"
char buf[BUFSIZ];
/*
* stuff you might want to change...
*
*/
int swb_ppnok() /* NOPE=can't run program, MAYBE=can't Create, Run or
Kill, YEP=full access */
{
return(YEP);
}
int swb_wiz() /* 1=access to operator program and no password kill */
/* 0=normal user */
{
if (getuid() == 54171) /* uid 54171 = chuck */
return(1);
else
return(0);
}
/* DO NOT EDIT BELOW THIS LINE */
void swb_note(msg, file, wiz)
int wiz;
char *msg, *file;
{
FILE *fopen(), *fp;
if ((fp = fopen(file, "r")) == NULL)
return;
printf("%s\r\n", msg);
while (fgets(buf, BUFSIZ, fp) != NULL)
if (buf[0] != '!' || wiz != 0)
printf("%s\r", buf);
printf("\n");
fclose(fp);
}