[SCM] Samba Shared Repository - branch master updated - 9eab2bfaf1a2f07451d0d40e9dc3323b0573a143

Jeremy Allison jra at samba.org
Wed Dec 31 02:25:25 GMT 2008


The branch, master has been updated
       via  9eab2bfaf1a2f07451d0d40e9dc3323b0573a143 (commit)
      from  a66c034c8e3da47bf492efb631a737581cc4b0d6 (commit)

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


- Log -----------------------------------------------------------------
commit 9eab2bfaf1a2f07451d0d40e9dc3323b0573a143
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Dec 30 18:24:39 2008 -0800

    Fix more "ignore return value" warnings from gcc 4.3.
    Jeremy

-----------------------------------------------------------------------

Summary of changes:
 source3/libads/kerberos_verify.c |   31 ++++++++++++++++++++++---------
 source3/web/cgi.c                |    4 +++-
 source3/web/neg_lang.c           |    3 +--
 source3/web/swat.c               |    8 +++++---
 4 files changed, 31 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libads/kerberos_verify.c b/source3/libads/kerberos_verify.c
index c667181..de3fdeb 100644
--- a/source3/libads/kerberos_verify.c
+++ b/source3/libads/kerberos_verify.c
@@ -69,13 +69,27 @@ static bool ads_keytab_verify_ticket(krb5_context context,
 	my_fqdn[0] = '\0';
 	name_to_fqdn(my_fqdn, global_myname());
 
-	asprintf(&valid_princ_formats[0], "%s$@%s", my_name, lp_realm());
-	asprintf(&valid_princ_formats[1], "host/%s@%s", my_name, lp_realm());
-	asprintf(&valid_princ_formats[2], "host/%s@%s", my_fqdn, lp_realm());
-	asprintf(&valid_princ_formats[3], "host/%s.%s@%s", my_name, lp_realm(), lp_realm());
-	asprintf(&valid_princ_formats[4], "cifs/%s@%s", my_name, lp_realm());
-	asprintf(&valid_princ_formats[5], "cifs/%s@%s", my_fqdn, lp_realm());
-	asprintf(&valid_princ_formats[6], "cifs/%s.%s@%s", my_name, lp_realm(), lp_realm());
+	if (asprintf(&valid_princ_formats[0], "%s$@%s", my_name, lp_realm()) == -1) {
+		goto out;
+	}
+	if (asprintf(&valid_princ_formats[1], "host/%s@%s", my_name, lp_realm()) == -1) {
+		goto out;
+	}
+	if (asprintf(&valid_princ_formats[2], "host/%s@%s", my_fqdn, lp_realm()) == -1) {
+		goto out;
+	}
+	if (asprintf(&valid_princ_formats[3], "host/%s.%s@%s", my_name, lp_realm(), lp_realm()) == -1) {
+		goto out;
+	}
+	if (asprintf(&valid_princ_formats[4], "cifs/%s@%s", my_name, lp_realm()) == -1) {
+		goto out;
+	}
+	if (asprintf(&valid_princ_formats[5], "cifs/%s@%s", my_fqdn, lp_realm()) == -1) {
+		goto out;
+	}
+	if (asprintf(&valid_princ_formats[6], "cifs/%s.%s@%s", my_name, lp_realm(), lp_realm()) == -1) {
+		goto out;
+	}
 
 	ZERO_STRUCT(kt_entry);
 	ZERO_STRUCT(kt_cursor);
@@ -375,8 +389,7 @@ NTSTATUS ads_verify_ticket(TALLOC_CTX *mem_ctx,
 		krb5_auth_con_setflags( context, auth_context, flags );
 	}
 
-	asprintf(&host_princ_s, "%s$", global_myname());
-	if (!host_princ_s) {
+	if (asprintf(&host_princ_s, "%s$", global_myname()) == -1) {
 		goto out;
 	}
 
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 49e8371..40f9ee6 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -498,7 +498,9 @@ static void cgi_download(char *file)
 
 	printf("Content-Length: %d\r\n\r\n", (int)st.st_size);
 	while ((l=read(fd,buf,sizeof(buf)))>0) {
-		fwrite(buf, 1, l, stdout);
+		if (fwrite(buf, 1, l, stdout) != l) {
+			break;
+		}
 	}
 	close(fd);
 	exit(0);
diff --git a/source3/web/neg_lang.c b/source3/web/neg_lang.c
index 491ca9e..ae33dfc 100644
--- a/source3/web/neg_lang.c
+++ b/source3/web/neg_lang.c
@@ -32,8 +32,7 @@ int web_open(const char *fname, int flags, mode_t mode)
 	char *lang = lang_tdb_current();
 	int fd;
 	if (lang) {
-		asprintf(&p, "lang/%s/%s", lang, fname);
-		if (p) {
+		if (asprintf(&p, "lang/%s/%s", lang, fname) != -1) {
 			fd = sys_open(p, flags, mode);
 			free(p);
 			if (fd != -1) {
diff --git a/source3/web/swat.c b/source3/web/swat.c
index b729e3b..060f024 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -156,7 +156,9 @@ static int include_html(const char *fname)
 	}
 
 	while ((ret = read(fd, buf, sizeof(buf))) > 0) {
-		write(1, buf, ret);
+		if (write(1, buf, ret) == -1) {
+			break;
+		}
 	}
 
 	close(fd);
@@ -1253,8 +1255,8 @@ static void printers_page(void)
         printf("<H2>%s</H2>\n", _("Printer Parameters"));
  
         printf("<H3>%s</H3>\n", _("Important Note:"));
-        printf(_("Printer names marked with [*] in the Choose Printer drop-down box "));
-        printf(_("are autoloaded printers from "));
+        printf("%s",_("Printer names marked with [*] in the Choose Printer drop-down box "));
+        printf("%s",_("are autoloaded printers from "));
         printf("<A HREF=\"/swat/help/smb.conf.5.html#printcapname\" target=\"docs\">%s</A>\n", _("Printcap Name"));
         printf("%s\n", _("Attempting to delete these printers from SWAT will have no effect."));
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list