diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/client/smbmount.c | 46 | ||||
-rw-r--r-- | source4/lib/gencache/gencache.c | 38 |
2 files changed, 42 insertions, 42 deletions
diff --git a/source4/client/smbmount.c b/source4/client/smbmount.c index 9d505be4a6..31e7628fcd 100644 --- a/source4/client/smbmount.c +++ b/source4/client/smbmount.c @@ -34,18 +34,18 @@ static pstring service; 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 @@ static struct smbcli_state *do_connection(char *the_service) /* 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 @@ static struct smbcli_state *do_connection(char *the_service) 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 @@ static struct smbcli_state *do_connection(char *the_service) DEBUG(4,("%d: tconx ok\n", sys_getpid())); - got_pass = True; + got_pass = true; return c; } @@ -539,7 +539,7 @@ static void get_password_file(void) { int fd = -1; char *p; - BOOL close_it = False; + bool close_it = false; pstring spec; char pass[128]; @@ -547,7 +547,7 @@ static void get_password_file(void) 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 @@ static void get_password_file(void) 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 @@ static void read_credentials_file(char *filename) 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 @@ static void parse_mount_smb(int argc, char **argv) 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 @@ static void parse_mount_smb(int argc, char **argv) } 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 @@ static void parse_mount_smb(int argc, char **argv) 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 @@ static void parse_mount_smb(int argc, char **argv) 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 @@ static void parse_mount_smb(int argc, char **argv) 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 @@ static void parse_mount_smb(int argc, char **argv) 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 @@ static void parse_mount_smb(int argc, char **argv) parse_mount_smb(argc, argv); if (use_kerberos && !got_user) { - got_pass = True; + got_pass = true; } if (*credentials != 0) { diff --git a/source4/lib/gencache/gencache.c b/source4/lib/gencache/gencache.c index 30bb1d86ed..949b16cb3b 100644 --- a/source4/lib/gencache/gencache.c +++ b/source4/lib/gencache/gencache.c @@ -47,13 +47,13 @@ static struct tdb_wrap *cache; * 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 @@ BOOL gencache_init(void) 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 @@ BOOL gencache_init(void) * 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 @@ BOOL gencache_shutdown(void) * @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 @@ BOOL gencache_set(const char *keystr, const char *value, time_t timeout) /* 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 @@ BOOL gencache_set(const char *keystr, const char *value, time_t timeout) * @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 @@ BOOL gencache_set_only(const char *keystr, const char *valstr, time_t timeout) /* 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 @@ BOOL gencache_set_only(const char *keystr, const char *valstr, time_t timeout) */ 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 @@ BOOL gencache_set_only(const char *keystr, const char *valstr, time_t timeout) * @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 @@ BOOL gencache_del(const char *keystr) /* 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 @@ BOOL gencache_del(const char *keystr) * 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 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout) 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 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout) DEBUG(10, ("Cache entry with key = %s couldn't be found\n", keystr)); - return False; + return false; } } |