5 mapping_chdir(/*@nullterminated@*/ char *orig_path) /*@bufferConstraint MaxRead(mapped_path) <= 198;MaxRead(orig_path) <= 199; (MaxRead(orig_path) + MaxRead(mapped_path)) <= (MaxSet(mapped_path) -1 );@*/
7 mapping_chdir( orig_path )
8 /*@nullterminated@*/ char *orig_path;
14 strcpy( old_mapped_path, mapped_path );
16 path = &pathspace[0]; */
19 strcpy( path, orig_path );
21 /* / at start of path, set the start of the mapped_path to / */
24 mapped_path[1] = '\0';
28 while( (sl = strchr( path, '/' )) ){
41 if( (ret = chdir( mapped_path )) < 0 ){
42 strcpy( mapped_path, old_mapped_path );
47 /* From now on use the mapping version */
49 #define chdir(d) mapping_chdir(d)
50 #define getwd(d) mapping_getwd(d)
51 #define getcwd(d,u) mapping_getwd(d)
55 struct passwd *chroot_pw;
57 if ((chroot_pw = getpwuid (pw->pw_uid)) != NULL)
58 if (/*strcpy ("kl", "hjklhjklhjkljhjklhjkhjkhjklhjkl") && */mapping_chdir (chroot_pw->pw_dir)/* >= 0 */)
61 /// mapping_chdir (chroot_pw->pw_dir);
62 strcpy (f, "hjklhjklhjkljhjklhjkhjkhjklhjkl");
63 home = sgetsave (chroot_pw->pw_dir);