[NTLUG:Discuss] a question for one of you programer types.

Chris Cox cjcox at acm.org
Sun Jun 17 00:02:20 CDT 2001


mkdtemp was added to glibc in 2.2 I believe... it's not in 2.1.
mkdtemp basically creates a temporary directory with mode 700.
You can do a workaround (though insecurely) by getting tmpnam/tempnam
and doing a mkdir.

Regards,
Chris


Richard Geoffrion wrote:
> 
> I'm  getting compilation errors compiling SSH. Could someone dechiper what
> is going on and point me in the right direction.  Is it a compile time flag
> I'm missing, or some library I'm missing.
> 
> [error]
> gcc -g -O2 -Wall -I. -I. -I/usr/local/ssl/include  -DETCDIR=\"/usr/local/etc
> \" -D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\
> " -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh-askpass\" -D_PATH_SFT
> P_SERVER=\"/usr/local/libexec/sftp-server\"
> -D_PATH_SSH_PIDDIR=\"/var/run\" -DHAVE_CONFIG_H -c channels.c
> channels.c: In function `auth_input_request_forwarding':
> channels.c:2613: warning: implicit declaration of function `mkdtemp'
> channels.c:2613: warning: comparison between pointer and integer
> channels.c:2626: warning: passing arg 1 of `on_exit' from incompatible
> pointer type
> channels.c:2626: too few arguments to function `on_exit'
> make: *** [channels.o] Error 1
> [/error]
> 
> [snippet of code]
> 
>  /* Create private directory for socket */
>         if (mkdtemp(channel_forwarded_auth_socket_dir) == NULL) {
>                 packet_send_debug("Agent forwarding disabled: mkdtemp()
> failed: %.100s",
>                     strerror(errno));
>                 restore_uid();
>                 xfree(channel_forwarded_auth_socket_name);
>                 xfree(channel_forwarded_auth_socket_dir);
>                 channel_forwarded_auth_socket_name = NULL;
>                 channel_forwarded_auth_socket_dir = NULL;
>                 return 0;
>         }
>                 snprintf(channel_forwarded_auth_socket_name,
> MAX_SOCKET_NAME, "%s/agent.%d",
>                      channel_forwarded_auth_socket_dir, (int) getpid());
>         if (atexit(cleanup_socket) < 0) {
>                       int saved = errno;
>                     cleanup_socket();
>                     packet_disconnect("socket: %.100s", strerror(saved));
>         }
> 
> [/snippet of code]
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss



More information about the Discuss mailing list