summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-01-11 10:36:04 +0100
committerJeremy Allison <jra@samba.org>2013-01-14 09:01:37 -0800
commitd87ad906df96ac82924ccaf1a127b20c745f1dca (patch)
tree2c06f4cd38b359c87e3199aaec632b2ab5d66c12 /source3
parentbef944166ab5b5e6dcceaeb4655b20bd7f2fc4d2 (diff)
downloadsamba-d87ad906df96ac82924ccaf1a127b20c745f1dca.tar.gz
samba-d87ad906df96ac82924ccaf1a127b20c745f1dca.tar.bz2
samba-d87ad906df96ac82924ccaf1a127b20c745f1dca.zip
samr: Make use of posix_openpt
Reviewed by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in2
-rw-r--r--source3/rpc_server/samr/srv_samr_chgpasswd.c4
-rw-r--r--source3/wscript2
3 files changed, 6 insertions, 2 deletions
diff --git a/source3/configure.in b/source3/configure.in
index bd3bffe390..359113143b 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -970,7 +970,7 @@ AC_CHECK_FUNCS(sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetg
AC_CHECK_FUNCS(initgroups select rdchk getgrnam getgrent pathconf)
AC_CHECK_FUNCS(getgrset)
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups syscall sysconf)
-AC_CHECK_FUNCS(atexit grantpt posix_fallocate)
+AC_CHECK_FUNCS(atexit grantpt posix_openpt posix_fallocate)
AC_CHECK_FUNCS(fallocate)
AC_CHECK_FUNCS(fseeko setluid getpwanam)
AC_CHECK_FUNCS(fdopendir)
diff --git a/source3/rpc_server/samr/srv_samr_chgpasswd.c b/source3/rpc_server/samr/srv_samr_chgpasswd.c
index 3d04899a53..db1f459c8d 100644
--- a/source3/rpc_server/samr/srv_samr_chgpasswd.c
+++ b/source3/rpc_server/samr/srv_samr_chgpasswd.c
@@ -73,8 +73,12 @@ static int findpty(char **slave)
*slave = NULL;
#if defined(HAVE_GRANTPT)
+#if defined(HAVE_POSIX_OPENPT)
+ master = posix_openpt(O_RDWR|O_NOCTTY);
+#else
/* Try to open /dev/ptmx. If that fails, fall through to old method. */
master = open("/dev/ptmx", O_RDWR, 0);
+#endif
if (master >= 0) {
grantpt(master);
unlockpt(master);
diff --git a/source3/wscript b/source3/wscript
index 9a1cd684fd..50787165f2 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -81,7 +81,7 @@ def configure(conf):
conf.CHECK_FUNCS('sigprocmask sigblock sigaction sigset innetgr')
conf.CHECK_FUNCS('initgroups select poll rdchk getgrnam getgrent pathconf')
conf.CHECK_FUNCS('setpriv setgidx setuidx setgroups syscall sysconf')
- conf.CHECK_FUNCS('atexit grantpt fallocate posix_fallocate')
+ conf.CHECK_FUNCS('atexit grantpt posix_openpt fallocate posix_fallocate')
conf.CHECK_FUNCS('fseeko setluid')
conf.CHECK_FUNCS('getpwnam', headers='sys/types.h pwd.h')
conf.CHECK_FUNCS('fdopendir')