#endif
#include <time.h>
+#ifdef SYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
+
#include "pppd.h"
#include "fsm.h"
#include "lcp.h"
#include "pathnames.h"
#include "session.h"
-static const char rcsid[] = RCSID;
/* Bits in scan_authfile return value */
#define NONWILD_SERVER 1
euid = geteuid();
if (seteuid(getuid()) == -1) {
option_error("unable to reset uid before opening %s: %m", fname);
+ free(fname);
return 0;
}
ufile = fopen(fname, "r");
fatal("unable to regain privileges: %m");
if (ufile == NULL) {
option_error("unable to open user login data file %s", fname);
+ free(fname);
return 0;
}
check_access(ufile, fname);
|| fgets(p, MAXSECRETLEN - 1, ufile) == NULL) {
fclose(ufile);
option_error("unable to read user login data file %s", fname);
+ free(fname);
return 0;
}
fclose(ufile);
explicit_passwd = 1;
}
+ free(fname);
return (1);
}
void start_link(unit)
int unit;
{
- char *msg;
-
+ status = EXIT_CONNECT_FAILED;
new_phase(PHASE_SERIALCONN);
hungup = 0;
devfd = the_channel->connect();
- msg = "Connect script failed";
if (devfd < 0)
goto fail;
* gives us. Thus we don't need the tdb_writelock/tdb_writeunlock.
*/
fd_ppp = the_channel->establish_ppp(devfd);
- msg = "ppp establishment failed";
if (fd_ppp < 0) {
status = EXIT_FATAL_ERROR;
goto disconnect;
(*the_channel->cleanup)();
if (doing_multilink && multilink_master) {
- if (!bundle_terminating)
+ if (!bundle_terminating) {
new_phase(PHASE_MASTER);
- else
+ if (master_detach && !detached)
+ detach();
+ } else
mp_bundle_terminated();
} else
new_phase(PHASE_DEAD);
/*
* Detach now, if the updetach option was given.
*/
- if (updetach && !nodetach)
+ if (updetach && !nodetach) {
+ dbglog("updetach is set. Now detaching.");
detach();
+#ifdef SYSTEMD
+ } else if (nodetach && up_sdnotify) {
+ dbglog("up_sdnotify is set. Now notifying systemd: READY=1");
+ sd_notify(0, "READY=1");
+#endif
+ }
}
++num_np_up;
}