search for: strerror

Displaying 20 results from an estimated 1249 matches for "strerror".

2001 Apr 25
0
NeXT // Broken _POSIX_SAVED_ID patch
...temporarily_use_uid_effective = 1; + /* Save the current euid, and egroups. */ +#ifdef SAVED_IDS_WORK_WITH_SETEUID + saved_euid = geteuid(); saved_egid = getegid(); - saved_egroupslen = getgroups(NGROUPS_MAX, saved_egroups); - if (saved_egroupslen < 0) - fatal("getgroups: %.100s", strerror(errno)); - - /* set and save the user's groups */ - if (user_groupslen == -1) { - if (initgroups(pw->pw_name, pw->pw_gid) < 0) - fatal("initgroups: %s: %.100s", pw->pw_name, - strerror(errno)); - user_groupslen = getgroups(NGROUPS_MAX, user_groups); - if...
2012 Jun 16
1
[PATCH][git-pull] Update strerror() to give english messages
The following changes since commit 753ab4bde224205876f09889ce928acb3682ba73: H. Peter Anvin (1): Merge remote-tracking branch 'genec/linux-com32-error-message-for-hpa' are available in the git repository at: git://github.com/geneC/syslinux.git strerror-for-hpa Gene Cumm (4): errno.h: Strip it of unused macros strerror: Use klibc version com32 strerror: add errlist.o to Make com32 strerror(): Remove macro WITH_ERRLIST use .gitignore | 1 + com32/include/errno.h | 111 ---------------------------------...
2001 Oct 08
2
Porting OpenSSH 2.9.9p2 to Dynix V4.4.4
...found what I believe might be a bug in uidswap.c at line 88. It used to look like: ----- #ifndef SAVED_IDS_WORK_WITH_SETEUID /* Propagate the privileged gid to all of our gids. */ if (setgid(getegid()) < 0) debug("setgid %u: %.100s", (u_int) getegid(), strerror(errno)); /* Propagate the privileged uid to all of our uids. */ if (setuid(geteuid()) < 0) debug("setuid %u: %.100s", (u_int) geteuid(), strerror(errno)); #endif /* SAVED_IDS_WORK_WITH_SETEUID */ if (setegid(pw->pw_gid) < 0)...
2002 Mar 29
1
Two patches for OpenSSH 3.1p1 (fwd)
...openssh-3.1p1/entropy.c Tue Jan 22 11:57:54 2002 --- openssh-3.1p1-peter/entropy.c Mon Mar 18 22:00:10 2002 *************** *** 110,118 **** close(p[0]); ! if (waitpid(pid, &ret, 0) == -1) ! fatal("Couldn't wait for ssh-rand-helper completion: %s", strerror(errno)); /* We don't mind if the child exits upon a SIGPIPE */ if (!WIFEXITED(ret) && --- 110,124 ---- close(p[0]); ! { ! int code; ! ! while ((code = waitpid(pid, &ret, 0)) == -1 && errno == EINTR) ! ; ! if (code < 0) ! fatal(...
2012 Sep 14
1
[PATCH] xenpm: make argument parsing and error handling more consistent
...pufreq_para(xc_handle, i, SCALING_MAX_FREQ, freq) ) - fprintf(stderr, "[CPU%d] failed to set scaling max freq\n", i); + fprintf(stderr, + "[CPU%d] failed to set scaling max freq (%d - %s)\n", + i, errno, strerror(errno)); } else { if ( xc_set_cpufreq_para(xc_handle, cpuid, SCALING_MAX_FREQ, freq) ) - fprintf(stderr, "failed to set scaling max freq\n"); + fprintf(stderr, "failed to set scaling max freq (%d - %s)\n", + errno,...
2007 Oct 18
0
[PATCH] Use a control socket directory to restrict access
..._un addr; + char *lastslash; + const char *controlsocketbasename = controlsocketname; - if(strlen(controlsocketname) >= sizeof addr.sun_path) { + control_socket = socket(PF_UNIX, SOCK_STREAM, 0); + + if(control_socket < 0) { + logger(LOG_ERR, _("Creating UNIX socket failed: %s"), strerror(errno)); + goto bail; + } + + /* + * This is rather elaborate for security: + * - On Solaris, we need to restrict traversal into a socket's parent + * directory to restrict who can connect. Thus, we require + * uid=root, perms=0700. Create it if it doesn't exist. + * - We want to...
2002 Jun 26
5
[PATCH] improved chroot handling
....1.1 +++ sshd.c 26 Jun 2002 18:00:25 -0000 @@ -545,14 +545,9 @@ memset(pw->pw_passwd, 0, strlen(pw->pw_passwd)); endpwent(); - /* Change our root directory*/ - if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1) - fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR, - strerror(errno)); - if (chdir("/") == -1) - fatal("chdir(\"/\"): %s", strerror(errno)); - - /* Drop our privileges */ + /* Change our root directory and drop privileges */ + if (chroot(".") < 0) + fatal("chroot(): %s\n", strerror(errno)); debug3(&quot...
2001 Feb 21
2
SCO 5.0.5 setluid patch
...on.drk.c 1024a1025,1031 > /* DRK: moved this stuff up higher */ > #if defined(HAVE_GETLUID) && defined(HAVE_SETLUID) > /* Sets login uid for accounting */ > if (getluid() == -1 && setluid(pw->pw_uid) == -1) > error("setluid: %s", strerror(errno)); > #endif /* defined(HAVE_GETLUID) && defined(HAVE_SETLUID) */ > 1128,1133d1134 < < #if defined(HAVE_GETLUID) && defined(HAVE_SETLUID) < /* Sets login uid for accounting */ < if (getluid() == -1 && setluid(pw->pw_uid) == -1) <...
2013 Dec 07
1
Potential crash due to missing declaration of strerror
Hi, I've just stumbled over this gcc warning while building OpenSSH: openbsd-compat/bsd-setres_id.c:41:3: warning: implicit declaration of function ?strerror? [-Wimplicit-function-declaration] error("setregid %u: %.100s", rgid, strerror(errno)); ^ openbsd-compat/bsd-setres_id.c:41:3: warning: format ?%s? expects argument of type ?char *?, but argument 3 has type ?int? [-Wformat=] This almost certainly results in a crash on systems...
2001 Oct 08
1
Ported OpenSSH 2.9.9p2 to Dynix
.../local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" *** uidswap.c Thu Apr 26 15:10:15 2001 --- uidswap.c.new Mon Oct 8 11:33:42 2001 *************** *** 85,91 **** if (setgroups(user_groupslen, user_groups) < 0) fatal("setgroups: %.100s", strerror(errno)); #endif /* !HAVE_CYWIN */ ! #ifndef SAVED_IDS_WORK_WITH_SETEUID /* Propagate the privileged gid to all of our gids. */ if (setgid(getegid()) < 0) debug("setgid %u: %.100s", (u_int) getegid(), strerror(errno)); --- 85,98 ---- if (setgrou...
2001 Sep 28
1
openssh-2.9.9p2 assumes pid_t, uid_t, etc. are not 'long'
...%.100s must be mode 0600, owned by uid %ld", + filename, (long)getuid()); return(0); } @@ -621,8 +621,8 @@ prng_write_seedfile(void) { pw = getpwuid(original_uid); if (pw == NULL) - fatal("Couldn't get password entry for current user (%i): %s", - original_uid, strerror(errno)); + fatal("Couldn't get password entry for current user (%ld): %s", + (long)original_uid, strerror(errno)); /* Try to ensure that the parent directory is there */ snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir, @@ -660,8 +660,8 @@ prng_read_s...
2002 Mar 26
1
Two patches for OpenSSH 3.1p1
...openssh-3.1p1/entropy.c Tue Jan 22 11:57:54 2002 --- openssh-3.1p1-peter/entropy.c Mon Mar 18 22:00:10 2002 *************** *** 110,118 **** close(p[0]); ! if (waitpid(pid, &ret, 0) == -1) ! fatal("Couldn't wait for ssh-rand-helper completion: %s", strerror(errno)); /* We don't mind if the child exits upon a SIGPIPE */ if (!WIFEXITED(ret) && --- 110,124 ---- close(p[0]); ! { ! int code; ! ! while ((code = waitpid(pid, &ret, 0)) == -1 && errno == EINTR) ! ; ! if (code < 0) ! fatal(...
2002 May 16
3
uidswap
All, Could someone explain the purpose of the uidswap functions with respect to ssh ( the client ). From what I gathered , ssh installs as setuid root and swaps ids when reading potential key files that may be read only by root. Also , I think when binding to a privileged port ssh swaps id. Is that so? What are the consequnences if you do not install ssh setuid root? ( As far I as know no uid
2002 Jun 07
4
openssh for UWIN
...ppropriate streams modules, as described in Solaris pts(7). * HP-UX pts(7) doesn't have ttcompat module. *** uidswap.c.orig Thu Dec 20 22:45:52 2001 --- uidswap.c Thu May 30 16:36:30 2002 *************** *** 80,86 **** if (user_groupslen < 0) fatal("getgroups: %.100s", strerror(errno)); } ! #ifndef HAVE_CYGWIN /* Set the effective uid to the given (unprivileged) uid. */ if (setgroups(user_groupslen, user_groups) < 0) fatal("setgroups: %.100s", strerror(errno)); --- 80,86 ---- if (user_groupslen < 0) fatal("getgroups: %.100s"...
2002 Nov 05
2
[PATCH] Add a chroot_users option to sshd
...nt-pw->pw_dir] = '\0'; + strcat(home, snapshot); + strcat(home, current + strlen("current") ); + } + else + strcpy(home, pw->pw_dir); + if (chroot(home) < 0) { + fprintf(stderr, "Could not chroot to home directory %s: %s\n", + home, strerror(errno)); + strcpy(home, pw->pw_dir); + if (chroot(home) < 0) { + fprintf(stderr, "Could not chroot to home directory %s: %s\n", + home, strerror(errno)); + } + } + if (idx != NULL) + command = idx + 1; + } + else { + #endif /* DO_SNAPSHOTS */ +...
2008 May 16
1
error: failed reading from tcp: Connection reset by peer
...ve included a very short patch to NSD that seems to do the trick. -- Shane --- server.c.orig 2008-05-16 10:20:25.000000000 +0200 +++ server.c 2008-05-16 10:21:44.000000000 +0200 @@ -1394,7 +1394,9 @@ */ return; } else { - log_msg(LOG_ERR, "failed reading from tcp: %s", strerror(errno)); + if (errno != ECONNRESET) { + log_msg(LOG_ERR, "failed reading from tcp: %s", strerror(errno)); + } cleanup_tcp_handler(netio, handler); return; } @@ -1454,7 +1456,9 @@ */ return; } else { - log_msg(LOG_ERR, "failed reading from tcp: %s...
2001 May 12
4
Erase the source file open; specify a tempfile name option
...rlen(src) + cmdlen + 20; bp = xmalloc(len); (void) snprintf(bp, len, "%s -f %s", cmd, src); if (do_cmd(host, suser, bp, &remin, &remout, argc) < 0) { @@ -582,7 +602,10 @@ (void) atomicio(write, remout, "", 1); else run_err("%s: %s", name, strerror(haderr)); - (void) response(); + if (response() == 0 && eraseflag && !haderr) { + if (unlink(name) < 0) + run_err("%s: %s", name, strerror(errno)); + } } } @@ -656,7 +679,7 @@ int amt, count, exists, first, mask, mode, ofd, omode; off_t size; int setim...
2006 Jul 17
2
SMF/process contracts in Solaris 10
I've searched the archive for this mailing list and the bug list for OpenSSH for this, and I'm finding nothing. I'd appreciate it if somoene could point me to an existing thread about this. (I know that other people are aware of the problem, though, so I'm a bit surprised to find nothing.) We're running OpenSSH under Solaris 10 using SMF instead of a legacy init script. SMF
2013 Aug 08
1
[PATCH v2 7/7] Sample Implementation of Intel MIC User Space Daemon.
...quot;; > + ifargv[3] = dev; > + ifargv[4] = "up"; > + ifargv[5] = NULL; > + mpsslog("Configuring %s\n", dev); > + ret = execvp("ip", ifargv); > + if (ret < 0) { > + mpsslog("%s execvp failed errno %s\n", > + mic->name, strerror(errno)); > + return ret; > + } > + } > + if (pid < 0) { > + mpsslog("%s fork failed errno %s\n", > + mic->name, strerror(errno)); > + return ret; > + } > + > + ret = waitpid(pid, NULL, 0); > + if (ret < 0) { > + mpsslog("%s waitpid...
2013 Aug 08
1
[PATCH v2 7/7] Sample Implementation of Intel MIC User Space Daemon.
...quot;; > + ifargv[3] = dev; > + ifargv[4] = "up"; > + ifargv[5] = NULL; > + mpsslog("Configuring %s\n", dev); > + ret = execvp("ip", ifargv); > + if (ret < 0) { > + mpsslog("%s execvp failed errno %s\n", > + mic->name, strerror(errno)); > + return ret; > + } > + } > + if (pid < 0) { > + mpsslog("%s fork failed errno %s\n", > + mic->name, strerror(errno)); > + return ret; > + } > + > + ret = waitpid(pid, NULL, 0); > + if (ret < 0) { > + mpsslog("%s waitpid...