svn commit: samba r25577 - in branches/SAMBA_4_0/source: client lib/gencache

metze at samba.org metze at samba.org
Mon Oct 8 14:19:35 GMT 2007


Author: metze
Date: 2007-10-08 14:19:35 +0000 (Mon, 08 Oct 2007)
New Revision: 25577

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25577

Log:
BOOL -> bool

metze
Modified:
   branches/SAMBA_4_0/source/client/smbmount.c
   branches/SAMBA_4_0/source/lib/gencache/gencache.c


Changeset:
Modified: branches/SAMBA_4_0/source/client/smbmount.c
===================================================================
--- branches/SAMBA_4_0/source/client/smbmount.c	2007-10-08 14:18:19 UTC (rev 25576)
+++ branches/SAMBA_4_0/source/client/smbmount.c	2007-10-08 14:19:35 UTC (rev 25577)
@@ -34,18 +34,18 @@
 static pstring options;
 
 static struct ipv4_addr dest_ip;
-static BOOL have_ip;
+static bool have_ip;
 static int smb_port = 0;
-static BOOL got_user;
-static BOOL got_pass;
+static bool got_user;
+static bool got_pass;
 static uid_t mount_uid;
 static gid_t mount_gid;
 static int mount_ro;
 static uint_t mount_fmask;
 static uint_t mount_dmask;
-static BOOL use_kerberos;
+static bool use_kerberos;
 /* TODO: Add code to detect smbfs version in kernel */
-static BOOL status32_smbfs = False;
+static bool status32_smbfs = false;
 
 static void usage(void);
 
@@ -155,10 +155,10 @@
 
 	/* SPNEGO doesn't work till we get NTSTATUS error support */
 	/* But it is REQUIRED for kerberos authentication */
-	if(!use_kerberos) c->use_spnego = False;
+	if(!use_kerberos) c->use_spnego = false;
 
 	/* The kernel doesn't yet know how to sign it's packets */
-	c->sign_info.allow_smb_signing = False;
+	c->sign_info.allow_smb_signing = false;
 
 	/* Use kerberos authentication if specified */
 	c->use_kerberos = use_kerberos;
@@ -204,7 +204,7 @@
 	    c->capabilities &= ~(CAP_UNICODE | CAP_LARGE_FILES | CAP_NT_SMBS |
 				 CAP_NT_FIND | CAP_STATUS32 |
 				 CAP_LEVEL_II_OPLOCKS);
-	    c->force_dos_errors = True;
+	    c->force_dos_errors = true;
 	}
 
 	if (!smbcli_session_setup(c, username, 
@@ -234,7 +234,7 @@
 
 	DEBUG(4,("%d: tconx ok\n", sys_getpid()));
 
-	got_pass = True;
+	got_pass = true;
 
 	return c;
 }
@@ -539,7 +539,7 @@
 {
 	int fd = -1;
 	char *p;
-	BOOL close_it = False;
+	bool close_it = false;
 	pstring spec;
 	char pass[128];
 
@@ -547,7 +547,7 @@
 		pstrcpy(spec, "descriptor ");
 		pstrcat(spec, p);
 		sscanf(p, "%d", &fd);
-		close_it = False;
+		close_it = false;
 	} else if ((p = getenv("PASSWD_FILE")) != NULL) {
 		fd = open(p, O_RDONLY, 0);
 		pstrcpy(spec, p);
@@ -556,7 +556,7 @@
 				spec, strerror(errno));
 			exit(1);
 		}
-		close_it = True;
+		close_it = true;
 	}
 
 	for(p = pass, *p = '\0'; /* ensure that pass is null-terminated */
@@ -637,7 +637,7 @@
 		if (strwicmp("password", param) == 0)
 		{
 			pstrcpy(password, val);
-			got_pass = True;
+			got_pass = true;
 		}
 		else if (strwicmp("username", param) == 0) {
 			pstrcpy(username, val);
@@ -750,12 +750,12 @@
                         if (!strcmp(opts, "username") || 
 			    !strcmp(opts, "logon")) {
 				char *lp;
-				got_user = True;
+				got_user = true;
 				pstrcpy(username,opteq+1);
 				if ((lp=strchr_m(username,'%'))) {
 					*lp = 0;
 					pstrcpy(password,lp+1);
-					got_pass = True;
+					got_pass = true;
 					memset(strchr_m(opteq+1,'%')+1,'X',strlen(password));
 				}
 				if ((lp=strchr_m(username,'/'))) {
@@ -765,7 +765,7 @@
 			} else if(!strcmp(opts, "passwd") ||
 				  !strcmp(opts, "password")) {
 				pstrcpy(password,opteq+1);
-				got_pass = True;
+				got_pass = true;
 				memset(opteq+1,'X',strlen(password));
 			} else if(!strcmp(opts, "credentials")) {
 				pstrcpy(credentials,opteq+1);
@@ -789,7 +789,7 @@
 					fprintf(stderr,"Can't resolve address %s\n", opteq+1);
 					exit(1);
 				}
-				have_ip = True;
+				have_ip = true;
 			} else if(!strcmp(opts, "workgroup")) {
 				pstrcpy(workgroup,opteq+1);
 			} else if(!strcmp(opts, "sockopt")) {
@@ -807,11 +807,11 @@
 				exit(1);
 			} else if(!strcmp(opts, "guest")) {
 				*password = '\0';
-				got_pass = True;
+				got_pass = true;
 			} else if(!strcmp(opts, "krb")) {
 #ifdef HAVE_KRB5
 
-				use_kerberos = True;
+				use_kerberos = true;
 				if(!status32_smbfs)
 					fprintf(stderr, "Warning: kerberos support will only work for samba servers\n");
 #else
@@ -873,7 +873,7 @@
 		if ((p=strchr_m(username,'%'))) {
 			*p = 0;
 			pstrcpy(password,p+1);
-			got_pass = True;
+			got_pass = true;
 			memset(strchr_m(getenv("USER"),'%')+1,'X',strlen(password));
 		}
 		strupper(username);
@@ -881,12 +881,12 @@
 
 	if (getenv("PASSWD")) {
 		pstrcpy(password,getenv("PASSWD"));
-		got_pass = True;
+		got_pass = true;
 	}
 
 	if (getenv("PASSWD_FD") || getenv("PASSWD_FILE")) {
 		get_password_file();
-		got_pass = True;
+		got_pass = true;
 	}
 
 	if (*username == 0 && getenv("LOGNAME")) {
@@ -901,7 +901,7 @@
 	parse_mount_smb(argc, argv);
 
 	if (use_kerberos && !got_user) {
-		got_pass = True;
+		got_pass = true;
 	}
 
 	if (*credentials != 0) {

Modified: branches/SAMBA_4_0/source/lib/gencache/gencache.c
===================================================================
--- branches/SAMBA_4_0/source/lib/gencache/gencache.c	2007-10-08 14:18:19 UTC (rev 25576)
+++ branches/SAMBA_4_0/source/lib/gencache/gencache.c	2007-10-08 14:19:35 UTC (rev 25577)
@@ -47,13 +47,13 @@
  *         false on failure
  **/
 
-BOOL gencache_init(void)
+bool gencache_init(void)
 {
 	char* cache_fname = NULL;
 	TALLOC_CTX *mem_ctx = talloc_autofree_context();
 	
 	/* skip file open if it's already opened */
-	if (cache) return True;
+	if (cache) return true;
 
 	cache_fname = lock_path(mem_ctx, global_loadparm, "gencache.tdb");
 	if (cache_fname != NULL) {
@@ -69,9 +69,9 @@
 	talloc_free(cache_fname);
 	if (!cache) {
 		DEBUG(5, ("Attempt to open gencache.tdb has failed.\n"));
-		return False;
+		return false;
 	}
-	return True;
+	return true;
 }
 
 
@@ -82,12 +82,12 @@
  *         false on failure during cache shutdown
  **/
  
-BOOL gencache_shutdown(void)
+bool gencache_shutdown(void)
 {
-	if (!cache) return False;
+	if (!cache) return false;
 	DEBUG(5, ("Closing cache file\n"));
 	talloc_free(cache);
-	return True;
+	return true;
 }
 
 
@@ -103,7 +103,7 @@
  * @retval false on failure
  **/
  
-BOOL gencache_set(const char *keystr, const char *value, time_t timeout)
+bool gencache_set(const char *keystr, const char *value, time_t timeout)
 {
 	int ret;
 	TDB_DATA keybuf, databuf;
@@ -112,11 +112,11 @@
 	/* fail completely if get null pointers passed */
 	SMB_ASSERT(keystr && value);
 
-	if (!gencache_init()) return False;
+	if (!gencache_init()) return false;
 	
 	asprintf(&valstr, CACHE_DATA_FMT, (int)timeout, value);
 	if (!valstr)
-		return False;
+		return false;
 
 	keybuf.dptr = (uint8_t *)strdup(keystr);
 	keybuf.dsize = strlen(keystr)+1;
@@ -146,7 +146,7 @@
  * @retval false on failure
  **/
 
-BOOL gencache_set_only(const char *keystr, const char *valstr, time_t timeout)
+bool gencache_set_only(const char *keystr, const char *valstr, time_t timeout)
 {
 	int ret = -1;
 	TDB_DATA keybuf, databuf;
@@ -156,7 +156,7 @@
 	/* fail completely if get null pointers passed */
 	SMB_ASSERT(keystr && valstr);
 
-	if (!gencache_init()) return False;
+	if (!gencache_init()) return false;
 			
 	/* 
 	 * Check whether entry exists in the cache
@@ -164,7 +164,7 @@
 	 */	
 	gencache_get(keystr, &old_valstr, &old_timeout);
 	
-	if (!(old_valstr && old_timeout)) return False;
+	if (!(old_valstr && old_timeout)) return false;
 		
 	DEBUG(10, ("Setting cache entry with key = %s; old value = %s and old timeout \
 	           = %s\n", keystr, old_valstr, ctime(&old_timeout)));
@@ -199,7 +199,7 @@
  * @retval false in case of failure
  **/
 
-BOOL gencache_del(const char *keystr)
+bool gencache_del(const char *keystr)
 {
 	int ret;
 	TDB_DATA keybuf;
@@ -207,7 +207,7 @@
 	/* fail completely if get null pointers passed */
 	SMB_ASSERT(keystr);
 
-	if (!gencache_init()) return False;	
+	if (!gencache_init()) return false;	
 	
 	keybuf.dptr = (uint8_t *)strdup(keystr);
 	keybuf.dsize = strlen(keystr)+1;
@@ -229,10 +229,10 @@
  *        timeout
  *
  * @retval true when entry is successfuly fetched
- * @retval False for failure
+ * @retval false for failure
  **/
 
-BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout)
+bool gencache_get(const char *keystr, char **valstr, time_t *timeout)
 {
 	TDB_DATA keybuf, databuf;
 
@@ -240,7 +240,7 @@
 	SMB_ASSERT(keystr);
 
 	if (!gencache_init())
-		return False;
+		return false;
 	
 	keybuf.dptr = (uint8_t *)strdup(keystr);
 	keybuf.dsize = strlen(keystr)+1;
@@ -286,7 +286,7 @@
 		DEBUG(10, ("Cache entry with key = %s couldn't be found\n", 
 			   keystr));
 
-		return False;
+		return false;
 	}
 }
 



More information about the samba-cvs mailing list