Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96315
b: refs/heads/master
c: 7c5e628
h: refs/heads/master
i:
  96313: 7e21bdb
  96311: 7a4751a
v: v3
  • Loading branch information
Igor Mammedov authored and Steve French committed May 8, 2008
1 parent f5bb3aa commit 5e751ea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf432eb50ffd03572c08a006f44e0069957cf300
refs/heads/master: 7c5e628f95b440b69332b1ed3eb112648fc8f7ff
2 changes: 1 addition & 1 deletion trunk/fs/cifs/cifsproto.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ extern unsigned int smbCalcSize(struct smb_hdr *ptr);
extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr);
extern int decode_negTokenInit(unsigned char *security_blob, int length,
enum securityEnum *secType);
extern int cifs_inet_pton(int, char *source, void *dst);
extern int cifs_inet_pton(const int, const char *source, void *dst);
extern int map_smb_to_linux_error(struct smb_hdr *smb, int logErr);
extern void header_assemble(struct smb_hdr *, char /* command */ ,
const struct cifsTconInfo *, int /* length of
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,9 @@ cifs_parse_mount_options(char *options, const char *devname,
"begin with // or \\\\ \n");
return 1;
}
value = strpbrk(vol->UNC+2, "/\\");
if (value)
*value = '\\';
} else {
printk(KERN_WARNING "CIFS: UNC name too long\n");
return 1;
Expand Down
32 changes: 1 addition & 31 deletions trunk/fs/cifs/netmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,47 +132,17 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = {
{0, 0}
};


/* if the mount helper is missing we need to reverse the 1st slash
from '/' to backslash in order to format the UNC properly for
ip address parsing and for tree connect (unless the user
remembered to put the UNC name in properly). Fortunately we do
not have to call this twice (we check for IPv4 addresses
first, so it is already converted by the time we
try IPv6 addresses */
static int canonicalize_unc(char *cp)
{
int i;

for (i = 0; i <= 46 /* INET6_ADDRSTRLEN */ ; i++) {
if (cp[i] == 0)
break;
if (cp[i] == '\\')
break;
if (cp[i] == '/') {
cFYI(DBG2, ("change slash to \\ in malformed UNC"));
cp[i] = '\\';
return 1;
}
}
return 0;
}

/* Convert string containing dotted ip address to binary form */
/* returns 0 if invalid address */

int
cifs_inet_pton(int address_family, char *cp, void *dst)
cifs_inet_pton(const int address_family, const char *cp, void *dst)
{
int ret = 0;

/* calculate length by finding first slash or NULL */
if (address_family == AF_INET) {
ret = in4_pton(cp, -1 /* len */, dst, '\\', NULL);
if (ret == 0) {
if (canonicalize_unc(cp))
ret = in4_pton(cp, -1, dst, '\\', NULL);
}
} else if (address_family == AF_INET6) {
ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL);
}
Expand Down

0 comments on commit 5e751ea

Please sign in to comment.