1 // Copyright 2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 ////////////////////////////////////////////////////////////////////////////////
16 #include <sys/socket.h>
17 #include <sys/types.h>
18 #include <sys/stat.h>
19 #include <grp.h>
20 #include <pwd.h>
21
__wrap_connect(int sockfd,const struct sockaddr * addr,socklen_t addrlen)22 int __wrap_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
23 return 0;
24 }
25
__wrap_bind(int sockfd,const struct sockaddr * addr,socklen_t addrlen)26 int __wrap_bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
27 return 0;
28 }
29
__wrap_shutdown(int socket,int how)30 int __wrap_shutdown(int socket, int how) { return 0; }
31
__wrap_listen(int fd,void * buf,size_t bytes)32 ssize_t __wrap_listen(int fd, void *buf, size_t bytes) { return 0; }
33
__wrap_setsockopt(int fd,int level,int optname,const void * optval,socklen_t optlen)34 int __wrap_setsockopt(int fd, int level, int optname, const void *optval,
35 socklen_t optlen) {
36 return 0;
37 }
38
__wrap_chmod(const char * pathname,mode_t mode)39 int __wrap_chmod(const char *pathname, mode_t mode){
40 return 0;
41 }
42
__wrap_chown(const char * pathname,uid_t owner,gid_t group)43 int __wrap_chown(const char *pathname, uid_t owner, gid_t group){
44 return 0;
45 }
46
47 struct passwd pwd;
48 struct group grp;
49
__wrap_getpwnam(const char * name)50 struct passwd *__wrap_getpwnam(const char *name){
51 pwd.pw_uid = 1;
52 return &pwd;
53 }
54
__wrap_getgrnam(const char * name)55 struct group *__wrap_getgrnam(const char *name){
56 grp.gr_gid = 1;
57 return &grp;
58 }
59