Version the functions in libsudo_util

This commit is contained in:
Todd C. Miller
2014-07-22 11:26:17 -06:00
parent 127ba1354b
commit 844a285391
29 changed files with 346 additions and 268 deletions

View File

@@ -37,7 +37,7 @@
/*
* Verify that path is the right type and not writable by other users.
*/
int
static int
sudo_secure_path(const char *path, unsigned int type, uid_t uid, gid_t gid, struct stat *sbp)
{
struct stat sb;
@@ -68,7 +68,7 @@ sudo_secure_path(const char *path, unsigned int type, uid_t uid, gid_t gid, stru
* Verify that path is a regular file and not writable by other users.
*/
int
sudo_secure_file(const char *path, uid_t uid, gid_t gid, struct stat *sbp)
sudo_secure_file_v1(const char *path, uid_t uid, gid_t gid, struct stat *sbp)
{
return sudo_secure_path(path, _S_IFREG, uid, gid, sbp);
}
@@ -77,7 +77,7 @@ sudo_secure_file(const char *path, uid_t uid, gid_t gid, struct stat *sbp)
* Verify that path is a directory and not writable by other users.
*/
int
sudo_secure_dir(const char *path, uid_t uid, gid_t gid, struct stat *sbp)
sudo_secure_dir_v1(const char *path, uid_t uid, gid_t gid, struct stat *sbp)
{
return sudo_secure_path(path, _S_IFDIR, uid, gid, sbp);
}