/[path-sandbox]/trunk/libsandbox.c
Gentoo

Diff of /trunk/libsandbox.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 163 Revision 164
1086 * passed path is writable, and if so, check if its a 1086 * passed path is writable, and if so, check if its a
1087 * symlink, and give access only if the resolved path 1087 * symlink, and give access only if the resolved path
1088 * of the symlink's parent also have write access. */ 1088 * of the symlink's parent also have write access. */
1089 if (((0 == strncmp(func, "unlink", 6)) || 1089 if (((0 == strncmp(func, "unlink", 6)) ||
1090 (0 == strncmp(func, "lchown", 6)) || 1090 (0 == strncmp(func, "lchown", 6)) ||
1091 (0 == strncmp(func, "rename", 6))) && 1091 (0 == strncmp(func, "rename", 6)) ||
1092 (0 == strncmp(func, "symlink", 7))) &&
1092 ((-1 != lstat(path, &st)) && (S_ISLNK(st.st_mode)))) { 1093 ((-1 != lstat(path, &st)) && (S_ISLNK(st.st_mode)))) {
1093 /* Check if the symlink unresolved path have access */ 1094 /* Check if the symlink unresolved path have access */
1094 retval = check_prefixes(sbcontext->write_prefixes, 1095 retval = check_prefixes(sbcontext->write_prefixes,
1095 sbcontext->num_write_prefixes, path); 1096 sbcontext->num_write_prefixes, path);
1096 if (1 == retval) { /* Does have write access on path */ 1097 if (1 == retval) { /* Does have write access on path */

Legend:
Removed from v.163  
changed lines
  Added in v.164

  ViewVC Help
Powered by ViewVC 1.1.20