summaryrefslogtreecommitdiff
path: root/source3/rpc_server/samr
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/rpc_server/samr
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/rpc_server/samr')
-rw-r--r--source3/rpc_server/samr/srv_samr_chgpasswd.c4
1 files changed, 4 insertions, 0 deletions
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);