]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afscp: null-terminate root.cell dir if needed in dynroot mode
authorDerrick Brashear <shadow@your-file-system.com>
Thu, 7 Mar 2013 11:53:16 +0000 (06:53 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sat, 30 Mar 2013 15:21:05 +0000 (08:21 -0700)
instead of doing a check for something which will never be true,
and then terminating, just terminate if it's not already
null-terminated.

Reviewed-on: http://gerrit.openafs.org/9439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit ceac74a6baad79155adaa692639b1d9f403525b6)

Change-Id: I14d3de25bca5b1ba1878048aac1973518f8c2359
Reviewed-on: http://gerrit.openafs.org/9583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/libafscp/afscp_dir.c

index 5233c156a06329396047bd54797ead964b28e6b0..513a78388d6e018ce195771e07e3d872e80ef938 100644 (file)
@@ -373,11 +373,8 @@ gettoproot(struct afscp_cell *cell, char *p, char **q,
            r = p;
            while (*r && *r != '/')
                r++;
-           if (!*r && !p) {
-               afscp_errno = ENODEV;
-               return 1;
-           }
-           *r++ = 0;
+           if (*r)
+               *r++ = 0;
            *q = r;
            afs_dprintf(("gettoproot: dynroot looking up cell %s\n", p));
            cell = afscp_CellByName(p, NULL);