summaryrefslogtreecommitdiff
path: root/source3/torture/locktest2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-04 16:56:18 -0800
committerJeremy Allison <jra@samba.org>2007-12-04 16:56:18 -0800
commitde7fd585b11413113304334dd75ba6a207ec69eb (patch)
treebfc8b1c808609b735036cc5b04971d10d61f6b91 /source3/torture/locktest2.c
parente262c41c6119957c5e4b8d5752040881021175a3 (diff)
downloadsamba-de7fd585b11413113304334dd75ba6a207ec69eb.tar.gz
samba-de7fd585b11413113304334dd75ba6a207ec69eb.tar.bz2
samba-de7fd585b11413113304334dd75ba6a207ec69eb.zip
The usual !pstring...
Jeremy. (This used to be commit b676262a781363e7be49b21817668a53cca75c2d)
Diffstat (limited to 'source3/torture/locktest2.c')
-rw-r--r--source3/torture/locktest2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c
index bdf9e51970..45a957e3a4 100644
--- a/source3/torture/locktest2.c
+++ b/source3/torture/locktest2.c
@@ -64,16 +64,21 @@ static struct record *recorded;
static int try_open(struct cli_state *c, char *nfs, int fstype, const char *fname, int flags)
{
- pstring path;
+ char *path;
switch (fstype) {
case FSTYPE_SMB:
return cli_open(c, fname, flags, DENY_NONE);
case FSTYPE_NFS:
- slprintf(path, sizeof(path), "%s%s", nfs, fname);
- pstring_sub(path,"\\", "/");
- return open(path, flags, 0666);
+ if (asprintf(&path, "%s%s", nfs, fname) > 0) {
+ int ret;
+ string_replace(path,'\\', '/');
+ ret = open(path, flags, 0666);
+ SAFE_FREE(path);
+ return ret;
+ }
+ break;
}
return -1;