差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
linux:lxc:非特権コンテナメモ [2014/01/20 10:43] – tenforward | linux:lxc:非特権コンテナメモ [2014/01/20 10:45] (現在) – tenforward | ||
---|---|---|---|
行 74: | 行 74: | ||
3: | 3: | ||
2: | 2: | ||
+ | * / | ||
+ | const char *e, *n; | ||
+ | char *s; | ||
+ | |||
+ | assert(path); | ||
+ | assert(session); | ||
+ | |||
+ | e = path_startswith(path, | ||
+ | if (!e) | ||
+ | return -ENOENT; | ||
+ | |||
+ | /* Skip the user name */ | ||
+ | e = skip_label(e); | ||
+ | if (!e) | ||
+ | return -ENOENT; | ||
+ | |||
+ | n = strchrnul(e, | ||
+ | if (n - e < 8) | ||
+ | return -ENOENT; | ||
+ | if (memcmp(n - 8, " | ||
+ | return -ENOENT; | ||
+ | |||
+ | s = strndup(e, n - e - 8); | ||
+ | if (!s) | ||
+ | return -ENOMEM; | ||
+ | |||
+ | *session = s; | ||
+ | return 0; | ||
+ | }</ |