diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-06-08 15:46:14 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-06-08 15:46:14 +0200 |
commit | c162a63997a3592f4d8a031cd31ee31bd1f17353 (patch) | |
tree | 41743b4bbc532fc03b5db7c64c9db50ee0591c88 /tests/mock_guest.c | |
parent | 3dcfac9148de47b625e421092ab4d6f407bd623d (diff) | |
parent | a5f1e6f66a82a3630919353a396e77845586121b (diff) | |
download | libpam-x2go-c162a63997a3592f4d8a031cd31ee31bd1f17353.tar.gz libpam-x2go-c162a63997a3592f4d8a031cd31ee31bd1f17353.tar.bz2 libpam-x2go-c162a63997a3592f4d8a031cd31ee31bd1f17353.zip |
Attributes GH PR #3: https://github.com/ArcticaProject/libpam-x2go/pull/3
Diffstat (limited to 'tests/mock_guest.c')
-rw-r--r-- | tests/mock_guest.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/mock_guest.c b/tests/mock_guest.c index 316e851..6bdfc6f 100644 --- a/tests/mock_guest.c +++ b/tests/mock_guest.c @@ -24,42 +24,48 @@ static struct passwd guest = { "guest", "/tmp", "/bin/true" }; struct passwd * -getpwnam (const char *username) +getpwnam (const char __attribute__((unused)) *username) { return &guest; } int -setgroups(size_t size, const gid_t *list) +setgroups(size_t __attribute__((unused)) size, + const __attribute__((unused)) gid_t *list) { errno = EPERM; return -1; } int -setgid(gid_t gid) +setgid(gid_t __attribute__((unused)) gid) { return 0; } int -setuid(uid_t uid) +setuid(uid_t __attribute__((unused)) uid) { return 0; } int -setegid(gid_t gid) +setegid(gid_t __attribute__((unused)) gid) { return 0; } int -seteuid(uid_t uid) +seteuid(uid_t __attribute__((unused)) uid) { return 0; } -int chmod(const char *path, mode_t mode) +int chmod(const char __attribute__((unused)) *path, + mode_t __attribute__((unused)) mode) { return 0; } -int chown(const char *path, uid_t owner, gid_t group) +int chown(const char __attribute__((unused)) *path, + uid_t __attribute__((unused)) owner, + gid_t __attribute__((unused)) group) { return 0; } -int execvp(const char *file, char *const argv[]) +int execvp(const char __attribute__((unused)) *file, + char __attribute__((unused)) *const argv[]) { return 0; } + /* wrap _exit, to make sure the gcov_exit function installed with atexit() is really called to collect coverage statistics */ void _exit (int exitcode) @@ -86,7 +92,7 @@ socket_sucker () serv_addr.sun_family = AF_UNIX; - int printsize = snprintf(serv_addr.sun_path, sizeof(serv_addr.sun_path) - 1, "%s/%s", home, ".x2go-socket"); + long unsigned int printsize = (long unsigned int)snprintf(serv_addr.sun_path, sizeof(serv_addr.sun_path) - 1, "%s/%s", home, ".x2go-socket"); if (printsize > sizeof(serv_addr.sun_path) - 1 || printsize < 0) { return -1; } |