]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add sys_mknodat() wrapper call.
authorJeremy Allison <jra@samba.org>
Tue, 20 Aug 2019 23:28:18 +0000 (16:28 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 22 Aug 2019 18:00:33 +0000 (18:00 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/include/proto.h
source3/lib/system.c
source3/wscript

index e3ed2b8e4cbd874cf6c9728d94c4b8594bd03559..17ea54fc4fe812626fba931de4ca618cb86fb184 100644 (file)
@@ -234,6 +234,7 @@ int sys_fallocate(int fd, uint32_t mode, off_t offset, off_t len);
 void kernel_flock(int fd, uint32_t share_mode, uint32_t access_mask);
 DIR *sys_fdopendir(int fd);
 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
+int sys_mknodat(int dirfd, const char *path, mode_t mode, SMB_DEV_T dev);
 char *sys_getwd(void);
 void set_effective_capability(enum smbd_capability capability);
 void drop_effective_capability(enum smbd_capability capability);
index a67388e436a8193785875751885b8458c20b85f7..251c02bb1ee9fcee2811cf1ff812445fce2d7d8a 100644 (file)
@@ -590,6 +590,21 @@ int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev)
 #endif
 }
 
+/*******************************************************************
+ A mknodat() wrapper.
+********************************************************************/
+
+int sys_mknodat(int dirfd, const char *path, mode_t mode, SMB_DEV_T dev)
+{
+#if defined(HAVE_MKNODAT)
+       return mknodat(dirfd, path, mode, dev);
+#else
+       /* No mknod system call. */
+       errno = ENOSYS;
+       return -1;
+#endif
+}
+
 /*******************************************************************
  System wrapper for getwd. Always returns MALLOC'ed memory, or NULL
  on error (malloc fail usually).
index ae3b03825a2c599774687e1e024001a2c33d425f..3118abd738b56147cb36c100f3271bcfe5cca36e 100644 (file)
@@ -103,7 +103,7 @@ def configure(conf):
     conf.CHECK_HEADERS('netdb.h')
     conf.CHECK_HEADERS('linux/falloc.h linux/ioctl.h')
 
-    conf.CHECK_FUNCS('getcwd fchown chmod fchmod mknod')
+    conf.CHECK_FUNCS('getcwd fchown chmod fchmod mknod mknodat')
     conf.CHECK_FUNCS('strtol strchr strupr chflags')
     conf.CHECK_FUNCS('getrlimit fsync fdatasync setpgid')
     conf.CHECK_FUNCS('setsid glob strpbrk crypt16 getauthuid')