1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Move sys_symlink() to libreplace.

This commit is contained in:
Jelmer Vernooij 2008-11-01 03:35:58 +01:00
parent dbda9adfaf
commit e8cda43e17
7 changed files with 18 additions and 19 deletions

View File

@ -67,6 +67,7 @@ utime
utimes
link
readlink
symlink
Types:
bool

View File

@ -108,7 +108,7 @@ AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)
AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp)
AC_CHECK_FUNCS(isatty chown link readlink)
AC_CHECK_FUNCS(isatty chown link readlink symlink)
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
AC_HAVE_DECL(setresgid, [#include <unistd.h>])
AC_HAVE_DECL(errno, [#include <errno.h>])

View File

@ -642,3 +642,11 @@ int rep_readlink(const char *path, char *buf, size_t bufsiz)
return -1;
}
#endif
#ifndef HAVE_SYMLINK
int rep_symlink(const char *oldpath, const char *newpath)
{
errno = ENOSYS;
return -1;
}
#endif

View File

@ -230,6 +230,12 @@ int rep_link(const char *oldpath, const char *newpath);
int rep_readlink(const char *path, char *buf, size_t bufsize);
#endif
#ifndef HAVE_SYMLINK
#define symlink rep_symlink
int rep_symlink(const char *oldpath, const char *newpath);
#endif
#ifndef HAVE_SETLINEBUF
#define setlinebuf rep_setlinebuf
void rep_setlinebuf(FILE *);

View File

@ -1003,8 +1003,6 @@ int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
char *sys_realpath(const char *path, char *resolved_path);
int sys_waitpid(pid_t pid,int *status,int options);
char *sys_getwd(char *s);
int sys_symlink(const char *oldpath, const char *newpath);
int sys_readlink(const char *path, char *buf, size_t bufsiz);
int sys_lchown(const char *fname,uid_t uid,gid_t gid);
int sys_chroot(const char *dname);
void set_effective_capability(enum smbd_capability capability);

View File

@ -580,20 +580,6 @@ char *sys_getwd(char *s)
return wd;
}
/*******************************************************************
system wrapper for symlink
********************************************************************/
int sys_symlink(const char *oldpath, const char *newpath)
{
#ifndef HAVE_SYMLINK
errno = ENOSYS;
return -1;
#else
return symlink(oldpath, newpath);
#endif
}
/*******************************************************************
Wrapper for lchown.
********************************************************************/

View File

@ -869,7 +869,7 @@ static int vfswrap_symlink(vfs_handle_struct *handle, const char *oldpath, cons
int result;
START_PROFILE(syscall_symlink);
result = sys_symlink(oldpath, newpath);
result = symlink(oldpath, newpath);
END_PROFILE(syscall_symlink);
return result;
}
@ -879,7 +879,7 @@ static int vfswrap_readlink(vfs_handle_struct *handle, const char *path, char *
int result;
START_PROFILE(syscall_readlink);
result = sys_readlink(path, buf, bufsiz);
result = readlink(path, buf, bufsiz);
END_PROFILE(syscall_readlink);
return result;
}