r12286: handle absolute path and url in lock_path() as in private_path()
authorStefan Metzmacher <metze@samba.org>
Fri, 16 Dec 2005 12:49:51 +0000 (12:49 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:27 +0000 (13:47 -0500)
metze

source/lib/util.c

index 1b51fe5e05f09cd6a47440805fdd9734f93ed1b6..2b13cd3d2f134325b87f7927ed7998503c2e3ce1 100644 (file)
@@ -610,6 +610,12 @@ char *name_to_fqdn(TALLOC_CTX *mem_ctx, const char *name)
 char *lock_path(TALLOC_CTX* mem_ctx, const char *name)
 {
        char *fname, *dname;
+       if (name == NULL) {
+               return NULL;
+       }
+       if (name[0] == 0 || name[0] == '/' || strstr(name, ":/")) {
+               return talloc_strdup(mem_ctx, name);
+       }
 
        dname = talloc_strdup(mem_ctx, lp_lockdir());
        trim_string(dname,"","/");