-/* $OpenBSD: login_cap.h,v 1.16 2018/07/29 19:40:41 deraadt Exp $ */
+/* $OpenBSD: login_cap.h,v 1.17 2021/06/03 13:19:45 deraadt Exp $ */
/*-
* Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
quad_t login_getcaptime(login_cap_t *, char *, quad_t, quad_t);
char *login_getstyle(login_cap_t *, char *, char *);
-int secure_path(char *);
int setclasscontext(char *, unsigned int);
int setusercontext(login_cap_t *, struct passwd *, uid_t, unsigned int);
-/* $OpenBSD: login_cap.c,v 1.38 2019/10/18 17:14:08 tedu Exp $ */
+/* $OpenBSD: login_cap.c,v 1.39 2021/06/03 13:19:45 deraadt Exp $ */
/*
* Copyright (c) 2000-2004 Todd C. Miller <millert@openbsd.org>
return (m);
}
-int
-secure_path(char *path)
-{
- struct stat sb;
-
- /*
- * If not a regular file, or is owned/writeable by someone
- * other than root, quit.
- */
- if (lstat(path, &sb) == -1) {
- syslog(LOG_ERR, "cannot stat %s: %m", path);
- return (-1);
- } else if (!S_ISREG(sb.st_mode)) {
- syslog(LOG_ERR, "%s: not a regular file", path);
- return (-1);
- } else if (sb.st_uid != 0) {
- syslog(LOG_ERR, "%s: not owned by root", path);
- return (-1);
- } else if (sb.st_mode & (S_IWGRP | S_IWOTH)) {
- syslog(LOG_ERR, "%s: writable by non-root", path);
- return (-1);
- }
- return (0);
-}
-DEF_WEAK(secure_path);
-
/*
* Check whether or not a tilde in a string should be expanded.
* We only do expansion for things like "~", "~/...", ~me", "~me/...".
-/* $OpenBSD: login_cap.h,v 1.1 2015/09/13 19:58:50 guenther Exp $ */
+/* $OpenBSD: login_cap.h,v 1.2 2021/06/03 13:19:45 deraadt Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
PROTO_NORMAL(login_getcaptime);
PROTO_NORMAL(login_getclass);
PROTO_NORMAL(login_getstyle);
-PROTO_NORMAL(secure_path);
PROTO_DEPRECATED(setclasscontext);
PROTO_NORMAL(setusercontext);