From 9de39b568d5e613de0874681d65caa4c13257080 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 3 May 2008 14:09:24 +0800 Subject: [EXEC] Fixed _PATH_BSHELL warning With klcc we get klcc -DHAVE_CONFIG_H -I. -I.. -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN -Wall -D__CTYPE_NO_INLINE -MT exec.o -MD -MP -MF .deps/exec.Tpo -c -o exec.o exec.c exec.c: In function 'tryexec': exec.c:160: warning: comparison with string literal results in unspecified behavior Storing it in a local variable fixes the problem. Thanks to Dan McGee for reporting this. Signed-off-by: Herbert Xu --- ChangeLog | 4 ++++ src/exec.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5216521..1126b04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-03 Herbert Xu + + * Fixed _PATH_BSHELL warning. + 2008-05-02 Herbert Xu * Restored non-glibc getcwd support. diff --git a/src/exec.c b/src/exec.c index bbb70e8..42299ea 100644 --- a/src/exec.c +++ b/src/exec.c @@ -149,6 +149,8 @@ shellexec(char **argv, const char *path, int idx) STATIC void tryexec(char *cmd, char **argv, char **envp) { + char *const path_bshell = _PATH_BSHELL; + repeat: #ifdef SYSV do { @@ -157,9 +159,9 @@ repeat: #else execve(cmd, argv, envp); #endif - if (cmd != _PATH_BSHELL && errno == ENOEXEC) { + if (cmd != path_bshell && errno == ENOEXEC) { *argv-- = cmd; - *argv = cmd = _PATH_BSHELL; + *argv = cmd = path_bshell; goto repeat; } } -- cgit 1.4.1 input type='hidden' name='id' value='ef2be6e7def32d4e174f800e36fecff2e6b84f5c'/>
Commit message (Collapse)Author
2019-11-14Use struct timeval for sub-second precisionJune McEnroe
2019-11-14Remove server-time filter TODOJune McEnroe
I think it's fine to keep it separate since it's a core function of the bouncer.
2019-11-14Tweak filter regexesJune McEnroe
2019-11-14Filter multi-prefixJune McEnroe
2019-11-14Replace filters with regex replacesJune McEnroe
2019-11-13Refactor filterUserhostInNamesJune McEnroe
2019-11-13Factor out wordcpy for filtersJune McEnroe
2019-11-11Revert "Test getopt_config"June McEnroe
This reverts commit c8a771828e1d5fc8c476bbd650fafcfb7ba390a8. It just feels gross... idk.
2019-11-11Test getopt_configJune McEnroe
2019-11-11Add userhost-in-names to manualJune McEnroe
2019-11-11Skip initial NAMES parametersJune McEnroe
Channel names can contain '!' so splitting the whole message on it won't work. I hate this code though.
2019-11-11Filter userhost-in-namesJune McEnroe
I really want to be writing tests for these functions...
2019-11-10Compare words without copying in filtersJune McEnroe
2019-11-10Separate tags from all targetJune McEnroe
2019-11-10Filter invite-notifyJune McEnroe
2019-11-10Add capsicum note to READMEJune McEnroe
2019-11-10Filter extended-joinJune McEnroe
2019-11-10Expand client configuration documentation and list capabilitiesJune McEnroe
2019-11-10Request all supported caps from serverJune McEnroe
2019-11-10Filter ACCOUNT, AWAY, CHGHOST for incapable clientsJune McEnroe
2019-11-10Rename listen to localJune McEnroe
2019-11-09Remove extended-join and invite-notifyJune McEnroe
The remaining caps only generate new commands which can easily be filtered out when sending to clients so will be in the first pass of support. extended-join is probably safe to pass through unaltered, just causing extraneous parameters on JOIN commands, but maybe not. invite-notify reuses the INVITE command where the invited user is not self.
2019-11-09Maintain stateCaps and offer them to clientsJune McEnroe
2019-11-09Parse capabilitiesJune McEnroe
The list that I've defined are the ones that I expect to be able to enable probably without any clients breaking... And of course server-time which pounce implements itself.
2019-11-09Avoid the reserved _A names with BIT macroJune McEnroe
2019-11-09Define macro for bit flag enumsJune McEnroe
2019-11-08Check that password is hashedJune McEnroe
2019-11-08Avoid calling getopt_long again after it returns -1June McEnroe
On GNU, calling getopt_long again will reset optind back to the first non-option argument, which would cause an infinite loop of reading the same configurtion file forever.
2019-11-08Only change AWAY status for registered clientsJune McEnroe
Turns out I did eventually fix this, because I may want to implement "passive clients" for logging or notification stuff, which wouldn't affect AWAY status either.
2019-11-07Just write the example normallyJune McEnroe
2019-11-07Include path in readlinkat errorJune McEnroe
2019-11-07Call clientConsume before clientRecvJune McEnroe
This might reduce the frequency of a client getting its own message back because it was behind in the ring when it sent it.
2019-11-06Use -l:filename in Linux.mkJune McEnroe
2019-11-06Fix compat.h for #defined strlcpyJune McEnroe
2019-11-06Allow unsetting LIBRESSL_PREFIXJune McEnroe
2019-11-06Document calico service configurationJune McEnroe
2019-11-06Document SASL EXTERNAL configuration in more detailJune McEnroe
2019-11-06Document pounce service configurationJune McEnroe
2019-11-06Mention Darwin and GNU/Linux in READMEJune McEnroe
2019-11-06Assume LibreSSL from brew on DarwinJune McEnroe
2019-11-06Remove -DNO_EXPLICIT_BZERO from Darwin.mkJune McEnroe
2019-11-06Don't install rc scripts or dirs on LinuxJune McEnroe