Unverified Commit 898b34e6 by Stéphane Graber Committed by GitHub

Merge pull request #2565 from brauner/2018-08-22/more_fixes

remove last pam_cgfs special-casing
parents 95552b1b 9e99997b
......@@ -325,6 +325,7 @@ endif
if ENABLE_COMMANDS
# Binaries shipping with liblxc
init_lxc_SOURCES = cmd/lxc_init.c \
initutils.c initutils.h \
string_utils.c string_utils.h
lxc_monitord_SOURCES = cmd/lxc_monitord.c
lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
......@@ -389,8 +390,10 @@ if HAVE_PAM
pam_LTLIBRARIES = pam_cgfs.la
pam_cgfs_la_SOURCES = pam/pam_cgfs.c \
macro.h \
caps.c caps.h \
file_utils.c file_utils.h \
log.c log.h \
macro.h \
string_utils.c string_utils.h
if !HAVE_STRLCAT
......@@ -401,8 +404,7 @@ if !HAVE_STRLCPY
pam_cgfs_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
endif
pam_cgfs_la_CFLAGS = $(AM_CFLAGS) \
-DNO_LOG
pam_cgfs_la_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF
pam_cgfs_la_LIBADD = $(AM_LIBS) \
$(PAM_LIBS) \
......
......@@ -26,14 +26,17 @@
#include "config.h"
#include <stdio.h>
#include <linux/magic.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/param.h>
#include <sys/types.h>
#include <stdbool.h>
#include <sys/vfs.h>
#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#include <stdbool.h>
#include "list.h"
#include "ringbuf.h"
......
......@@ -31,9 +31,7 @@
#include "macro.h"
#include "string.h"
#ifndef NO_LOG
lxc_log_define(file_utils, lxc);
#endif
int lxc_write_to_file(const char *filename, const void *buf, size_t count,
bool add_newline, mode_t mode)
......
......@@ -217,13 +217,6 @@ out:
return values[i];
}
extern void remove_trailing_slashes(char *p)
{
int l = strlen(p);
while (--l >= 0 && (p[l] == '/' || p[l] == '\n'))
p[l] = '\0';
}
/*
* Sets the process title to the specified title. Note that this may fail if
* the kernel doesn't support PR_SET_MM_MAP (kernels <3.18).
......
......@@ -24,6 +24,8 @@
#ifndef __LXC_INITUTILS_H
#define __LXC_INITUTILS_H
#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
......@@ -31,12 +33,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "config.h"
#include "string_utils.h"
#define DEFAULT_VG "lxc"
#define DEFAULT_THIN_POOL "lxc"
......@@ -70,8 +72,6 @@ struct prctl_mm_map {
extern const char *lxc_global_config_value(const char *option_name);
/* open a file with O_CLOEXEC */
extern void remove_trailing_slashes(char *p);
extern int setproctitle(char *title);
#endif /* __LXC_INITUTILS_H */
......@@ -46,7 +46,6 @@
#include "namespace.h"
#include "parse.h"
#include "string_utils.h"
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
......@@ -56,9 +55,7 @@
#include "include/strlcat.h"
#endif
#ifndef NO_LOG
lxc_log_define(string_utils, lxc);
#endif
char **lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup)
{
......@@ -981,3 +978,10 @@ int lxc_is_line_empty(const char *line)
return 0;
return 1;
}
void remove_trailing_slashes(char *p)
{
int l = strlen(p);
while (--l >= 0 && (p[l] == '/' || p[l] == '\n'))
p[l] = '\0';
}
......@@ -22,22 +22,6 @@
#include "config.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include <linux/loop.h>
#include <linux/magic.h>
#include <linux/types.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/vfs.h>
#ifdef HAVE_LINUX_MEMFD_H
#include <linux/memfd.h>
#endif
#include "initutils.h"
#include "macro.h"
......@@ -127,5 +111,6 @@ extern int lxc_char_right_gc(const char *buffer, size_t len);
extern char *lxc_trim_whitespace_in_place(char *buffer);
extern int lxc_is_line_empty(const char *line);
extern void remove_trailing_slashes(char *p);
#endif /* __LXC_STRING_UTILS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment