summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2004-05-06 14:38:31 +0000
committerAlexander Bokovoy <ab@samba.org>2004-05-06 14:38:31 +0000
commitaff34af2112479df0b12210285bb7573a010ae8b (patch)
treecdab3517b3a009d1f84fe32ac70b5823a814c42a
parenta2e0417db0901a8229cec2f667745b580b0c0d2c (diff)
downloadsamba-aff34af2112479df0b12210285bb7573a010ae8b.tar.gz
samba-aff34af2112479df0b12210285bb7573a010ae8b.tar.xz
samba-aff34af2112479df0b12210285bb7573a010ae8b.zip
r516: On GNU/Linux distributions which allow to use both 2.4 and 2.6 kernels
there is SYS_utimes syscall defined at compile time in glibc-kernheaders but it is available on 2.6 kernels only. Therefore, we can't rely on syscall at compile time but have to check that behaviour during program execution. An easy workaround is to have replacement for utimes() implemented within our wrapper and do not rely on syscall at all. Thus, if REPLACE_UTIME is defined already (by packager), skip these syscall shortcuts.
-rw-r--r--source/smbwrapper/realcalls.h13
-rw-r--r--source/utils/ntlm_auth.c6
2 files changed, 19 insertions, 0 deletions
diff --git a/source/smbwrapper/realcalls.h b/source/smbwrapper/realcalls.h
index 6c230dba056..bad89d598c1 100644
--- a/source/smbwrapper/realcalls.h
+++ b/source/smbwrapper/realcalls.h
@@ -250,14 +250,27 @@
#define real_rmdir(fn) (syscall(SYS_rmdir, (fn)))
#define real_mkdir(fn, mode) (syscall(SYS_mkdir, (fn), (mode)))
+/*
+ * On GNU/Linux distributions which allow to use both 2.4 and 2.6 kernels
+ * there is SYS_utimes syscall defined at compile time in glibc-kernheaders but
+ * it is available on 2.6 kernels only. Therefore, we can't rely on syscall at
+ * compile time but have to check that behaviour during program execution. An easy
+ * workaround is to have replacement for utimes() implemented within our wrapper and
+ * do not rely on syscall at all. Thus, if REPLACE_UTIME is defined already (by packager),
+ * skip these syscall shortcuts.
+ */
+#ifndef REPLACE_UTIME
#ifdef SYS_utime
#define real_utime(fn, buf) (syscall(SYS_utime, (fn), (buf)))
#else
#define REPLACE_UTIME 1
#endif
+#endif
+#ifndef REPLACE_UTIMES
#ifdef SYS_utimes
#define real_utimes(fn, buf) (syscall(SYS_utimes, (fn), (buf)))
#else
#define REPLACE_UTIMES 1
#endif
+#endif
diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c
index f2fb7dcaaf3..686fd6256be 100644
--- a/source/utils/ntlm_auth.c
+++ b/source/utils/ntlm_auth.c
@@ -1624,6 +1624,12 @@ static void squid_stream(enum stdio_helper_mode stdio_mode, stdio_helper_functio
/* initialize FDescs */
x_setbuf(x_stdout, NULL);
x_setbuf(x_stderr, NULL);
+ {
+ struct passwd *pass = getpwuid(getuid());
+ if (initgroups (pass->pw_name, pass->pw_gid)) {
+ DEBUG(0,("Unable to initgroups. Error was %s\n", strerror(errno) ));
+ }
+ }
while(1) {
manage_squid_request(stdio_mode, fn);
}