From f793b62438a3cfdbcc5ba453eebee1db3f315bea Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 16 Jun 2009 15:58:07 -0700 Subject: Extend pt_chown to drop privileges. If libcap is available, use it to drop privileges in pt_chown before starting the work to change the permissions and ownership of the slave device. --- sysdeps/unix/grantpt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c index f664b9e..8c299e9 100644 --- a/sysdeps/unix/grantpt.c +++ b/sysdeps/unix/grantpt.c @@ -202,7 +202,7 @@ grantpt (int fd) if (!WIFEXITED (w)) __set_errno (ENOEXEC); else - switch (WEXITSTATUS(w)) + switch (WEXITSTATUS (w)) { case 0: retval = 0; @@ -219,6 +219,9 @@ grantpt (int fd) case FAIL_EXEC: __set_errno (ENOEXEC); break; + case FAIL_ENOMEM: + __set_errno (ENOMEM); + break; default: assert(! "getpt: internal error: invalid exit code from pt_chown"); -- cgit v1.1