=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/doas/doas.c,v retrieving revision 1.37 retrieving revision 1.38 diff -c -r1.37 -r1.38 *** src/usr.bin/doas/doas.c 2015/08/20 18:42:11 1.37 --- src/usr.bin/doas/doas.c 2015/08/22 16:01:05 1.38 *************** *** 1,4 **** ! /* $OpenBSD: doas.c,v 1.37 2015/08/20 18:42:11 rzalamena Exp $ */ /* * Copyright (c) 2015 Ted Unangst * --- 1,4 ---- ! /* $OpenBSD: doas.c,v 1.38 2015/08/22 16:01:05 doug Exp $ */ /* * Copyright (c) 2015 Ted Unangst * *************** *** 327,332 **** --- 327,334 ---- int i, ch; int sflag = 0; int nflag = 0; + char cwdpath[PATH_MAX]; + const char *cwd; uid = getuid(); *************** *** 423,430 **** LOGIN_SETUSER) != 0) errx(1, "failed to set user context for target"); ! syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command as %s: %s", ! myname, pw->pw_name, cmdline); if (setenv("PATH", safepath, 1) == -1) err(1, "failed to set PATH '%s'", safepath); execvpe(cmd, argv, envp); --- 425,438 ---- LOGIN_SETUSER) != 0) errx(1, "failed to set user context for target"); ! if (getcwd(cwdpath, sizeof(cwdpath)) == NULL) ! cwd = "(failed)"; ! else ! cwd = cwdpath; ! ! syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s", ! myname, cmdline, pw->pw_name, cwd); ! if (setenv("PATH", safepath, 1) == -1) err(1, "failed to set PATH '%s'", safepath); execvpe(cmd, argv, envp);