Commit 3870253e authored by Steve French's avatar Steve French

[CIFS] more whitespace fixes

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 790fe579
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* Error mapping routines from Samba libsmb/errormap.c * Error mapping routines from Samba libsmb/errormap.c
* Copyright (C) Andrew Tridgell 2001 * Copyright (C) Andrew Tridgell 2001
* *
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
...@@ -67,22 +66,22 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = { ...@@ -67,22 +66,22 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
{ERRbadshare, -ETXTBSY}, {ERRbadshare, -ETXTBSY},
{ERRlock, -EACCES}, {ERRlock, -EACCES},
{ERRunsup, -EINVAL}, {ERRunsup, -EINVAL},
{ERRnosuchshare,-ENXIO}, {ERRnosuchshare, -ENXIO},
{ERRfilexists, -EEXIST}, {ERRfilexists, -EEXIST},
{ERRinvparm, -EINVAL}, {ERRinvparm, -EINVAL},
{ERRdiskfull, -ENOSPC}, {ERRdiskfull, -ENOSPC},
{ERRinvname, -ENOENT}, {ERRinvname, -ENOENT},
{ERRinvlevel,-EOPNOTSUPP}, {ERRinvlevel, -EOPNOTSUPP},
{ERRdirnotempty, -ENOTEMPTY}, {ERRdirnotempty, -ENOTEMPTY},
{ERRnotlocked, -ENOLCK}, {ERRnotlocked, -ENOLCK},
{ERRcancelviolation, -ENOLCK}, {ERRcancelviolation, -ENOLCK},
{ERRalreadyexists, -EEXIST}, {ERRalreadyexists, -EEXIST},
{ERRmoredata, -EOVERFLOW}, {ERRmoredata, -EOVERFLOW},
{ERReasnotsupported,-EOPNOTSUPP}, {ERReasnotsupported, -EOPNOTSUPP},
{ErrQuota, -EDQUOT}, {ErrQuota, -EDQUOT},
{ErrNotALink, -ENOLINK}, {ErrNotALink, -ENOLINK},
{ERRnetlogonNotStarted,-ENOPROTOOPT}, {ERRnetlogonNotStarted, -ENOPROTOOPT},
{ErrTooManyLinks,-EMLINK}, {ErrTooManyLinks, -EMLINK},
{0, 0} {0, 0}
}; };
...@@ -133,13 +132,13 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = { ...@@ -133,13 +132,13 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = {
/* returns 0 if invalid address */ /* returns 0 if invalid address */
int int
cifs_inet_pton(int address_family, char *cp,void *dst) cifs_inet_pton(int address_family, char *cp, void *dst)
{ {
int ret = 0; int ret = 0;
/* calculate length by finding first slash or NULL */ /* calculate length by finding first slash or NULL */
/* BB Should we convert '/' slash to '\' here since it seems already done /* BB Should we convert '/' slash to '\' here since it seems already
before this */ * done before this */
if ( address_family == AF_INET ) { if ( address_family == AF_INET ) {
ret = in4_pton(cp, -1 /* len */, dst , '\\', NULL); ret = in4_pton(cp, -1 /* len */, dst , '\\', NULL);
} else if ( address_family == AF_INET6 ) { } else if ( address_family == AF_INET6 ) {
...@@ -332,8 +331,8 @@ static const struct { ...@@ -332,8 +331,8 @@ static const struct {
ERRHRD, ERRgeneral, NT_STATUS_FILE_INVALID}, { ERRHRD, ERRgeneral, NT_STATUS_FILE_INVALID}, {
ERRHRD, ERRgeneral, NT_STATUS_ALLOTTED_SPACE_EXCEEDED}, ERRHRD, ERRgeneral, NT_STATUS_ALLOTTED_SPACE_EXCEEDED},
/* { This NT error code was 'sqashed' /* { This NT error code was 'sqashed'
from NT_STATUS_INSUFFICIENT_RESOURCES to NT_STATUS_INSUFF_SERVER_RESOURCES from NT_STATUS_INSUFFICIENT_RESOURCES to
during the session setup } */ NT_STATUS_INSUFF_SERVER_RESOURCES during the session setup } */
{ {
ERRDOS, ERRnomem, NT_STATUS_INSUFFICIENT_RESOURCES}, { ERRDOS, ERRnomem, NT_STATUS_INSUFFICIENT_RESOURCES}, {
ERRDOS, ERRbadpath, NT_STATUS_DFS_EXIT_PATH_FOUND}, { ERRDOS, ERRbadpath, NT_STATUS_DFS_EXIT_PATH_FOUND}, {
...@@ -577,8 +576,8 @@ static const struct { ...@@ -577,8 +576,8 @@ static const struct {
ERRDOS, 19, NT_STATUS_TOO_LATE}, { ERRDOS, 19, NT_STATUS_TOO_LATE}, {
ERRDOS, ERRnoaccess, NT_STATUS_NO_TRUST_LSA_SECRET}, ERRDOS, ERRnoaccess, NT_STATUS_NO_TRUST_LSA_SECRET},
/* { This NT error code was 'sqashed' /* { This NT error code was 'sqashed'
from NT_STATUS_NO_TRUST_SAM_ACCOUNT to NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE from NT_STATUS_NO_TRUST_SAM_ACCOUNT to
during the session setup } */ NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE during the session setup } */
{ {
ERRDOS, ERRnoaccess, NT_STATUS_NO_TRUST_SAM_ACCOUNT}, { ERRDOS, ERRnoaccess, NT_STATUS_NO_TRUST_SAM_ACCOUNT}, {
ERRDOS, ERRnoaccess, NT_STATUS_TRUSTED_DOMAIN_FAILURE}, { ERRDOS, ERRnoaccess, NT_STATUS_TRUSTED_DOMAIN_FAILURE}, {
...@@ -728,7 +727,7 @@ cifs_print_status(__u32 status_code) ...@@ -728,7 +727,7 @@ cifs_print_status(__u32 status_code)
if (((nt_errs[idx].nt_errcode) & 0xFFFFFF) == if (((nt_errs[idx].nt_errcode) & 0xFFFFFF) ==
(status_code & 0xFFFFFF)) { (status_code & 0xFFFFFF)) {
printk(KERN_NOTICE "Status code returned 0x%08x %s\n", printk(KERN_NOTICE "Status code returned 0x%08x %s\n",
status_code,nt_errs[idx].nt_errstr); status_code, nt_errs[idx].nt_errstr);
} }
idx++; idx++;
} }
...@@ -771,7 +770,8 @@ map_smb_to_linux_error(struct smb_hdr *smb) ...@@ -771,7 +770,8 @@ map_smb_to_linux_error(struct smb_hdr *smb)
return 0; return 0;
if (smb->Flags2 & SMBFLG2_ERR_STATUS) { if (smb->Flags2 & SMBFLG2_ERR_STATUS) {
/* translate the newer STATUS codes to old style errors and then to POSIX errors */ /* translate the newer STATUS codes to old style SMB errors
* and then to POSIX errors */
__u32 err = le32_to_cpu(smb->Status.CifsError); __u32 err = le32_to_cpu(smb->Status.CifsError);
if (cifsFYI & CIFS_RC) if (cifsFYI & CIFS_RC)
cifs_print_status(err); cifs_print_status(err);
...@@ -784,7 +784,7 @@ map_smb_to_linux_error(struct smb_hdr *smb) ...@@ -784,7 +784,7 @@ map_smb_to_linux_error(struct smb_hdr *smb)
/* old style errors */ /* old style errors */
/* DOS class smb error codes - map DOS */ /* DOS class smb error codes - map DOS */
if (smberrclass == ERRDOS) { /* one byte field no need to byte reverse */ if (smberrclass == ERRDOS) { /* 1 byte field no need to byte reverse */
for (i = 0; for (i = 0;
i < i <
sizeof (mapping_table_ERRDOS) / sizeof (mapping_table_ERRDOS) /
...@@ -795,7 +795,7 @@ map_smb_to_linux_error(struct smb_hdr *smb) ...@@ -795,7 +795,7 @@ map_smb_to_linux_error(struct smb_hdr *smb)
rc = mapping_table_ERRDOS[i].posix_code; rc = mapping_table_ERRDOS[i].posix_code;
break; break;
} }
/* else try the next error mapping one to see if it will match */ /* else try next error mapping one to see if match */
} }
} else if (smberrclass == ERRSRV) { /* server class of error codes */ } else if (smberrclass == ERRSRV) { /* server class of error codes */
for (i = 0; for (i = 0;
...@@ -808,14 +808,16 @@ map_smb_to_linux_error(struct smb_hdr *smb) ...@@ -808,14 +808,16 @@ map_smb_to_linux_error(struct smb_hdr *smb)
rc = mapping_table_ERRSRV[i].posix_code; rc = mapping_table_ERRSRV[i].posix_code;
break; break;
} }
/* else try the next error mapping one to see if it will match */ /* else try next error mapping to see if match */
} }
} }
/* else ERRHRD class errors or junk - return EIO */ /* else ERRHRD class errors or junk - return EIO */
cFYI(1, (" !!Mapping smb error code %d to POSIX err %d !!", smberrcode,rc)); cFYI(1, (" !!Mapping smb error code %d to POSIX err %d !!",
smberrcode, rc));
/* generic corrective action e.g. reconnect SMB session on ERRbaduid could be added */ /* generic corrective action e.g. reconnect SMB session on
* ERRbaduid could be added */
return rc; return rc;
} }
...@@ -885,20 +887,20 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time) ...@@ -885,20 +887,20 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
SMB_TIME * st = (SMB_TIME *)&time; SMB_TIME * st = (SMB_TIME *)&time;
SMB_DATE * sd = (SMB_DATE *)&date; SMB_DATE * sd = (SMB_DATE *)&date;
cFYI(1,("date %d time %d",date, time)); cFYI(1, ("date %d time %d", date, time));
sec = 2 * st->TwoSeconds; sec = 2 * st->TwoSeconds;
min = st->Minutes; min = st->Minutes;
if ((sec > 59) || (min > 59)) if ((sec > 59) || (min > 59))
cERROR(1,("illegal time min %d sec %d", min, sec)); cERROR(1, ("illegal time min %d sec %d", min, sec));
sec += (min * 60); sec += (min * 60);
sec += 60 * 60 * st->Hours; sec += 60 * 60 * st->Hours;
if (st->Hours > 24) if (st->Hours > 24)
cERROR(1,("illegal hours %d",st->Hours)); cERROR(1, ("illegal hours %d", st->Hours));
days = sd->Day; days = sd->Day;
month = sd->Month; month = sd->Month;
if ((days > 31) || (month > 12)) if ((days > 31) || (month > 12))
cERROR(1,("illegal date, month %d day: %d", month, days)); cERROR(1, ("illegal date, month %d day: %d", month, days));
month -= 1; month -= 1;
days += total_days_of_prev_months[month]; days += total_days_of_prev_months[month];
days += 3652; /* account for difference in days between 1980 and 1970 */ days += 3652; /* account for difference in days between 1980 and 1970 */
......
This diff is collapsed.
...@@ -75,7 +75,7 @@ static __u32 cifs_ssetup_hdr(struct cifsSesInfo *ses, SESSION_SETUP_ANDX *pSMB) ...@@ -75,7 +75,7 @@ static __u32 cifs_ssetup_hdr(struct cifsSesInfo *ses, SESSION_SETUP_ANDX *pSMB)
return capabilities; return capabilities;
} }
static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, static void unicode_ssetup_strings(char **pbcc_area, struct cifsSesInfo *ses,
const struct nls_table *nls_cp) const struct nls_table *nls_cp)
{ {
char *bcc_ptr = *pbcc_area; char *bcc_ptr = *pbcc_area;
...@@ -130,7 +130,7 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, ...@@ -130,7 +130,7 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
*pbcc_area = bcc_ptr; *pbcc_area = bcc_ptr;
} }
static void ascii_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses, static void ascii_ssetup_strings(char **pbcc_area, struct cifsSesInfo *ses,
const struct nls_table *nls_cp) const struct nls_table *nls_cp)
{ {
char *bcc_ptr = *pbcc_area; char *bcc_ptr = *pbcc_area;
...@@ -468,7 +468,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, ...@@ -468,7 +468,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
/* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE); /* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
bcc_ptr += LM2_SESS_KEY_SIZE; */ bcc_ptr += LM2_SESS_KEY_SIZE; */
memcpy(bcc_ptr, (char *)v2_sess_key, sizeof(struct ntlmv2_resp)); memcpy(bcc_ptr, (char *)v2_sess_key,
sizeof(struct ntlmv2_resp));
bcc_ptr += sizeof(struct ntlmv2_resp); bcc_ptr += sizeof(struct ntlmv2_resp);
kfree(v2_sess_key); kfree(v2_sess_key);
if (ses->capabilities & CAP_UNICODE) { if (ses->capabilities & CAP_UNICODE) {
......
...@@ -153,7 +153,7 @@ static uchar sbox[8][4][16] = { ...@@ -153,7 +153,7 @@ static uchar sbox[8][4][16] = {
}; };
static void static void
permute(char *out, char *in, uchar * p, int n) permute(char *out, char *in, uchar *p, int n)
{ {
int i; int i;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
...@@ -202,18 +202,18 @@ dohash(char *out, char *in, char *key, int forw) ...@@ -202,18 +202,18 @@ dohash(char *out, char *in, char *key, int forw)
char *rl; char *rl;
/* Have to reduce stack usage */ /* Have to reduce stack usage */
pk1 = kmalloc(56+56+64+64,GFP_KERNEL); pk1 = kmalloc(56+56+64+64, GFP_KERNEL);
if(pk1 == NULL) if (pk1 == NULL)
return; return;
ki = kmalloc(16*48, GFP_KERNEL); ki = kmalloc(16*48, GFP_KERNEL);
if(ki == NULL) { if (ki == NULL) {
kfree(pk1); kfree(pk1);
return; return;
} }
cd = pk1 + 56; cd = pk1 + 56;
pd1= cd + 56; pd1 = cd + 56;
rl = pd1 + 64; rl = pd1 + 64;
permute(pk1, key, perm1, 56); permute(pk1, key, perm1, 56);
...@@ -247,7 +247,7 @@ dohash(char *out, char *in, char *key, int forw) ...@@ -247,7 +247,7 @@ dohash(char *out, char *in, char *key, int forw)
char *r2; /* r2[32] */ char *r2; /* r2[32] */
er = kmalloc(48+48+32+32+32, GFP_KERNEL); er = kmalloc(48+48+32+32+32, GFP_KERNEL);
if(er == NULL) { if (er == NULL) {
kfree(pk1); kfree(pk1);
kfree(ki); kfree(ki);
return; return;
...@@ -327,8 +327,8 @@ smbhash(unsigned char *out, unsigned char *in, unsigned char *key, int forw) ...@@ -327,8 +327,8 @@ smbhash(unsigned char *out, unsigned char *in, unsigned char *key, int forw)
char *keyb; /* keyb[64] */ char *keyb; /* keyb[64] */
unsigned char key2[8]; unsigned char key2[8];
outb = kmalloc(64 * 3,GFP_KERNEL); outb = kmalloc(64 * 3, GFP_KERNEL);
if(outb == NULL) if (outb == NULL)
return; return;
inb = outb + 64; inb = outb + 64;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment