[SCM] Samba Shared Repository - branch master updated

2013-04-04 Thread Alexander Bokovoy
The branch, master has been updated
   via  ca0d385 getpass: Don't fail if stdin is not a tty
  from  7f366d7 tevent: Only set poll_ev->delete=false if it was true

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit ca0d38596d711e70a1d58657024aabd8c131512b
Author: Stef Walter 
Date:   Thu Apr 4 15:55:10 2013 +0200

getpass: Don't fail if stdin is not a tty

We don't need to manipulate the tty state (such as turning off
echo) when prompting for passwords if we're not reading from a tty.

Reviewed-by: Jeremy Allison 
Reviewed-by: Alexander Bokovoy 

Autobuild-User(master): Alexander Bokovoy 
Autobuild-Date(master): Fri Apr  5 07:34:37 CEST 2013 on sn-devel-104

---

Summary of changes:
 lib/util/getpass.c |   52 +---
 1 files changed, 29 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/getpass.c b/lib/util/getpass.c
index 480bd56..0cbc7dd 100644
--- a/lib/util/getpass.c
+++ b/lib/util/getpass.c
@@ -170,31 +170,34 @@ int samba_getpass(const char *prompt,
return -1;
}
 
-   ZERO_STRUCT(attr);
-   ZERO_STRUCT(old_attr);
+   if (isatty (STDIN_FILENO)) {
 
-   /* get local terminal attributes */
-   if (tcgetattr(STDIN_FILENO, &attr) < 0) {
-   perror("tcgetattr");
-   return -1;
-   }
+   ZERO_STRUCT(attr);
+   ZERO_STRUCT(old_attr);
 
-   /* save terminal attributes */
-   memcpy(&old_attr, &attr, sizeof(attr));
-   if((fd = fcntl(0, F_GETFL, 0)) < 0) {
-   perror("fcntl");
-   return -1;
-   }
+   /* get local terminal attributes */
+   if (tcgetattr(STDIN_FILENO, &attr) < 0) {
+   perror("tcgetattr");
+   return -1;
+   }
 
-   /* disable echo */
-   if (!echo) {
-   attr.c_lflag &= ~(ECHO);
-   }
+   /* save terminal attributes */
+   memcpy(&old_attr, &attr, sizeof(attr));
+   if((fd = fcntl(0, F_GETFL, 0)) < 0) {
+   perror("fcntl");
+   return -1;
+   }
 
-   /* write attributes to terminal */
-   if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) < 0) {
-   perror("tcsetattr");
-   return -1;
+   /* disable echo */
+   if (!echo) {
+   attr.c_lflag &= ~(ECHO);
+   }
+
+   /* write attributes to terminal */
+   if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) < 0) {
+   perror("tcsetattr");
+   return -1;
+   }
}
 
/* disable nonblocking I/O */
@@ -204,8 +207,11 @@ int samba_getpass(const char *prompt,
 
ok = samba_gets(prompt, buf, len, verify);
 
-   /* reset terminal */
-   tcsetattr(STDIN_FILENO, TCSANOW, &old_attr);
+   if (isatty (STDIN_FILENO)) {
+
+   /* reset terminal */
+   tcsetattr(STDIN_FILENO, TCSANOW, &old_attr);
+   }
 
/* close fd */
if (fd & O_NDELAY) {


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2013-04-04 Thread Stefan Metzmacher
The branch, master has been updated
   via  7f366d7 tevent: Only set poll_ev->delete=false if it was true
  from  a7f067c BUG 9699: Fix adding case sensitive spn.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 7f366d745c1d4e833470d853ec484459157616e7
Author: Volker Lendecke 
Date:   Thu Apr 4 10:23:02 2013 +0200

tevent: Only set poll_ev->delete=false if it was true

Might not be noticable, but I thought it would be an obvious tiny
optimization. Possibly the compiler already does this.

Signed-off-by: Volker Lendecke 
Reviewed-by: Stefan Metzmacher 

Autobuild-User(master): Stefan Metzmacher 
Autobuild-Date(master): Thu Apr  4 18:32:39 CEST 2013 on sn-devel-104

---

Summary of changes:
 lib/tevent/tevent_poll.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c
index 92fcc44..c6e2a00 100644
--- a/lib/tevent/tevent_poll.c
+++ b/lib/tevent/tevent_poll.c
@@ -419,8 +419,8 @@ static bool poll_event_setup_fresh(struct tevent_context 
*ev,
poll_ev->fdes[i]->additional_flags = i;
}
}
+   poll_ev->deleted = false;
}
-   poll_ev->deleted = false;
 
if (poll_ev->fresh == NULL) {
return true;


-- 
Samba Shared Repository