File: unknwn.c

package info (click to toggle)
uucp 1.07-19.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,964 kB
  • ctags: 3,210
  • sloc: ansic: 53,817; sh: 4,491; makefile: 232; perl: 199
file content (43 lines) | stat: -rw-r--r-- 986 bytes parent folder | download | duplicates (14)
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
/* unknwn.c
   Check remote.unknown shell script.  */

#include "uucp.h"

#include "uudefs.h"
#include "sysdep.h"
#include "system.h"

#include <errno.h>

/* Run the remote.unknown shell script.  If it succeeds, we return
   FALSE because that means that the system is not permitted to log
   in.  If the execution fails, we return TRUE.  */

boolean
fsysdep_unknown_caller (zscript, zsystem)
     const char *zscript;
     const char *zsystem;
{
  const char *azargs[3];
  int aidescs[3];
  pid_t ipid;

  azargs[0] = zscript;
  azargs[1] = zsystem;
  azargs[2] = NULL;

  aidescs[0] = SPAWN_NULL;
  aidescs[1] = SPAWN_NULL;
  aidescs[2] = SPAWN_NULL;

  ipid = ixsspawn (azargs, aidescs, TRUE, TRUE, (const char *) NULL, FALSE,
		   TRUE, (const char *) NULL, (const char *) NULL,
		   (const char *) NULL);
  if (ipid < 0)
    {
      ulog (LOG_ERROR, "ixsspawn: %s", strerror (errno));
      return FALSE;
    }

  return ixswait ((unsigned long) ipid, (const char *) NULL) != 0;
}