diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/bundle.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/command.c | 11 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/defs.c | 18 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/defs.h | 3 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/id.c | 20 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/id.h | 3 |
6 files changed, 26 insertions, 34 deletions
diff --git a/usr.sbin/ppp/ppp/bundle.c b/usr.sbin/ppp/ppp/bundle.c index 1dce09949d0..2594d89322f 100644 --- a/usr.sbin/ppp/ppp/bundle.c +++ b/usr.sbin/ppp/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: bundle.c,v 1.44 2000/08/15 10:26:34 brian Exp $ + * $OpenBSD: bundle.c,v 1.45 2000/08/16 09:07:26 brian Exp $ */ #include <sys/param.h> @@ -51,7 +51,6 @@ #include <sys/uio.h> #include <sys/wait.h> #if defined(__FreeBSD__) && !defined(NOKLDLOAD) -#include <sys/linker.h> #include <sys/module.h> #endif #include <termios.h> @@ -1852,7 +1851,7 @@ bundle_setsid(struct bundle *bundle, int holdsession) */ waitpid(pid, &status, 0); /* Tweak our process arguments.... */ - ID0setproctitle("session owner"); + SetTitle("session owner"); setuid(ID0realuid()); /* * Hang around for a HUP. This should happen as soon as the diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c index dc859141b68..17416f3e5e7 100644 --- a/usr.sbin/ppp/ppp/command.c +++ b/usr.sbin/ppp/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $OpenBSD: command.c,v 1.47 2000/08/15 10:26:35 brian Exp $ + * $OpenBSD: command.c,v 1.48 2000/08/16 09:07:27 brian Exp $ * */ #include <sys/param.h> @@ -33,11 +33,6 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> -#ifdef __OpenBSD__ -#include <util.h> -#else -#include <libutil.h> -#endif #include <paths.h> #include <stdio.h> #include <stdlib.h> @@ -2731,7 +2726,7 @@ SetProcTitle(struct cmdargs const *arg) int len, remaining, f, argc = arg->argc - arg->argn; if (arg->argc == arg->argn) { - ID0setproctitle(NULL); + SetTitle(NULL); return 0; } @@ -2757,7 +2752,7 @@ SetProcTitle(struct cmdargs const *arg) } *ptr = '\0'; - ID0setproctitle(title); + SetTitle(title); return 0; } diff --git a/usr.sbin/ppp/ppp/defs.c b/usr.sbin/ppp/ppp/defs.c index 369b25dccf1..7281011549f 100644 --- a/usr.sbin/ppp/ppp/defs.c +++ b/usr.sbin/ppp/ppp/defs.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: defs.c,v 1.12 2000/04/07 23:46:39 brian Exp $ + * $OpenBSD: defs.c,v 1.13 2000/08/16 09:07:27 brian Exp $ */ @@ -35,6 +35,11 @@ #include <ctype.h> #include <errno.h> +#ifdef __OpenBSD__ +#include <util.h> +#else +#include <libutil.h> +#endif #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -358,3 +363,14 @@ ex_desc(int ex) snprintf(num, sizeof num, "%d", ex); return num; } + +void +SetTitle(const char *title) +{ + if (title == NULL) + setproctitle(NULL); + else if (title[0] == '-' && title[1] != '\0') + setproctitle("-%s", title + 1); + else + setproctitle("%s", title); +} diff --git a/usr.sbin/ppp/ppp/defs.h b/usr.sbin/ppp/ppp/defs.h index a351ef3004c..e2a70eb0074 100644 --- a/usr.sbin/ppp/ppp/defs.h +++ b/usr.sbin/ppp/ppp/defs.h @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $OpenBSD: defs.h,v 1.15 2000/06/13 09:57:51 brian Exp $ + * $OpenBSD: defs.h,v 1.16 2000/08/16 09:07:27 brian Exp $ * * TODO: */ @@ -114,3 +114,4 @@ extern int MakeArgs(char *, char **, int, int); extern const char *NumStr(long, char *, size_t); extern const char *HexStr(long, char *, size_t); extern const char *ex_desc(int); +extern void SetTitle(const char *); diff --git a/usr.sbin/ppp/ppp/id.c b/usr.sbin/ppp/ppp/id.c index c88149ff2ce..a7d14ce7d33 100644 --- a/usr.sbin/ppp/ppp/id.c +++ b/usr.sbin/ppp/ppp/id.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: id.c,v 1.6 2000/08/11 09:40:24 brian Exp $ + * $OpenBSD: id.c,v 1.7 2000/08/16 09:07:27 brian Exp $ */ #include <sys/param.h> @@ -38,7 +38,6 @@ #include <signal.h> #include <stdarg.h> #include <stdio.h> -#include <stdlib.h> /* setproctitle() under OpenBSD (+NetBSD ?)*/ #include <string.h> #include <sysexits.h> #if defined(__FreeBSD__) && !defined(NOKLDLOAD) @@ -273,23 +272,6 @@ ID0kill(pid_t pid, int sig) return result; } -void -ID0setproctitle(const char *title) -{ - ID0set0(); - if (title == NULL) { - setproctitle(NULL); - log_Printf(LogID0, "setproctitle(NULL)\n"); - } else { - if (title[0] == '-' && title[1] != '\0') - setproctitle("-%s", title + 1); - else - setproctitle("%s", title); - log_Printf(LogID0, "setproctitle(\"%%s\", \"%s\")\n", title); - } - ID0setuser(); -} - #if defined(__FreeBSD__) && !defined(NOKLDLOAD) int ID0kldload(const char *dev) diff --git a/usr.sbin/ppp/ppp/id.h b/usr.sbin/ppp/ppp/id.h index 88e03f729e1..1145f142142 100644 --- a/usr.sbin/ppp/ppp/id.h +++ b/usr.sbin/ppp/ppp/id.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: id.h,v 1.4 2000/02/27 01:38:26 brian Exp $ + * $OpenBSD: id.h,v 1.5 2000/08/16 09:07:27 brian Exp $ */ struct utmp; @@ -45,7 +45,6 @@ extern void ID0logout(const char *, int); extern int ID0bind_un(int, const struct sockaddr_un *); extern int ID0connect_un(int, const struct sockaddr_un *); extern int ID0kill(pid_t, int); -extern void ID0setproctitle(const char *); #if defined(__FreeBSD__) && !defined(NOKLDLOAD) extern int ID0kldload(const char *); #endif |