]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afscp: Fix check for bare root.cell dirs in dynroot mode
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Mon, 4 Mar 2013 02:14:22 +0000 (21:14 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Mon, 4 Mar 2013 03:40:15 +0000 (19:40 -0800)
A previous fix (git commit fb1d7491fbe2e90300b23284f213cac2bdcd56ac)
added a check for '!p' in gettoproot(), but p is always a non-NULL pointer
(in part since it's dereferenced just above in the code), so the check
is always false.

Instead, I suspect the original author intended to check for '!*p',
which this patch does.

Change-Id: I1c0a2dd1d582a6b5e82275db18474343efa679a2
Reviewed-on: http://gerrit.openafs.org/9337
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/libafscp/afscp_dir.c

index b3d42b1c9b4dea7fcd5fe023aa313b2551350b92..f5470f5bdc8b49ffe6525d4e9c21bb2f86a0acd5 100644 (file)
@@ -370,7 +370,7 @@ gettoproot(struct afscp_cell *cell, char *p, char **q,
            r = p;
            while (*r && *r != '/')
                r++;
-           if (!*r && !p) {
+           if (!*r && !*p) {
                afscp_errno = ENODEV;
                return 1;
            }