git.samba.org
/
nivanova
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dbda9ad
)
Move sys_symlink() to libreplace.
author
Jelmer Vernooij
<jelmer@samba.org>
Sat, 1 Nov 2008 02:35:58 +0000
(
03:35
+0100)
committer
Jelmer Vernooij
<jelmer@samba.org>
Sat, 1 Nov 2008 02:35:58 +0000
(
03:35
+0100)
lib/replace/README
patch
|
blob
|
history
lib/replace/libreplace.m4
patch
|
blob
|
history
lib/replace/replace.c
patch
|
blob
|
history
lib/replace/replace.h
patch
|
blob
|
history
source3/include/proto.h
patch
|
blob
|
history
source3/lib/system.c
patch
|
blob
|
history
source3/modules/vfs_default.c
patch
|
blob
|
history
diff --git
a/lib/replace/README
b/lib/replace/README
index ed0b866e85721adacca7b88d3bebbcd8845ed1d7..f189e8716f8603eb49834058f4670182a7f8369b 100644
(file)
--- a/
lib/replace/README
+++ b/
lib/replace/README
@@
-67,6
+67,7
@@
utime
utimes
link
readlink
utimes
link
readlink
+symlink
Types:
bool
Types:
bool
diff --git
a/lib/replace/libreplace.m4
b/lib/replace/libreplace.m4
index 64df4ec57593b7b14f069566e63402fadc7f54cd..a93a9dad4529ac1ce05d5e68c1dd908229ceb1ae 100644
(file)
--- a/
lib/replace/libreplace.m4
+++ b/
lib/replace/libreplace.m4
@@
-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(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>])
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
AC_HAVE_DECL(setresgid, [#include <unistd.h>])
AC_HAVE_DECL(errno, [#include <errno.h>])
diff --git
a/lib/replace/replace.c
b/lib/replace/replace.c
index 00a205d4723deca3e738d7379ec110d1aa561417..37705b93cd6efafda26e216a2735c3369f9dec8f 100644
(file)
--- a/
lib/replace/replace.c
+++ b/
lib/replace/replace.c
@@
-642,3
+642,11
@@
int rep_readlink(const char *path, char *buf, size_t bufsiz)
return -1;
}
#endif
return -1;
}
#endif
+
+#ifndef HAVE_SYMLINK
+int rep_symlink(const char *oldpath, const char *newpath)
+{
+ errno = ENOSYS;
+ return -1;
+}
+#endif
diff --git
a/lib/replace/replace.h
b/lib/replace/replace.h
index fe01a8613e6bb82c994475813fd1323e91e46383..f56c5b0dc92f579d784e9aed1368d0a8384193be 100644
(file)
--- a/
lib/replace/replace.h
+++ b/
lib/replace/replace.h
@@
-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
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 *);
#ifndef HAVE_SETLINEBUF
#define setlinebuf rep_setlinebuf
void rep_setlinebuf(FILE *);
diff --git
a/source3/include/proto.h
b/source3/include/proto.h
index a731e9ef48bac21241cfa931ec0e2cbd4a246be5..7e6f608896d0527416043719206da0a1270443fc 100644
(file)
--- a/
source3/include/proto.h
+++ b/
source3/include/proto.h
@@
-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);
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);
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);
diff --git
a/source3/lib/system.c
b/source3/lib/system.c
index ac64954107473d64063d66507bedc63f2c640223..e2ed11d450b090519dc14fdc5f9e101a9206a5d0 100644
(file)
--- a/
source3/lib/system.c
+++ b/
source3/lib/system.c
@@
-580,20
+580,6
@@
char *sys_getwd(char *s)
return wd;
}
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.
********************************************************************/
/*******************************************************************
Wrapper for lchown.
********************************************************************/
diff --git
a/source3/modules/vfs_default.c
b/source3/modules/vfs_default.c
index f47ff8fdfc07f4b4f06c6952b217b81b563e6166..37b0fc392b5f94f02f69be363a413c0675503a82 100644
(file)
--- a/
source3/modules/vfs_default.c
+++ b/
source3/modules/vfs_default.c
@@
-869,7
+869,7
@@
static int vfswrap_symlink(vfs_handle_struct *handle, const char *oldpath, cons
int result;
START_PROFILE(syscall_symlink);
int result;
START_PROFILE(syscall_symlink);
- result = sy
s_sy
mlink(oldpath, newpath);
+ result = symlink(oldpath, newpath);
END_PROFILE(syscall_symlink);
return result;
}
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);
int result;
START_PROFILE(syscall_readlink);
- result =
sys_
readlink(path, buf, bufsiz);
+ result = readlink(path, buf, bufsiz);
END_PROFILE(syscall_readlink);
return result;
}
END_PROFILE(syscall_readlink);
return result;
}