- Timestamp:
- Oct 20, 2016, 7:12:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_unix.c
r497 r513 1210 1210 int level; 1211 1211 uid_t ff_euid = (uid_t) -1; 1212 uid_t baduid; 1213 gid_t badgid; 1212 1214 1213 1215 SL_ENTER(_("tf_trust_check")); … … 1256 1258 level = SH_ERR_ERR; 1257 1259 1258 tmp = sh_util_safe_name (file); 1259 p = sl_trust_errfile(); 1260 tmp = sh_util_safe_name (file); 1261 p = sh_util_strdup(sl_trust_errfile()); 1262 baduid = sl_trust_baduid(); 1263 badgid = sl_trust_badgid(); 1264 1260 1265 if (p && *p != '\0') 1261 1266 { 1262 tmp2 = sh_util_safe_name ( sl_trust_errfile());1267 tmp2 = sh_util_safe_name (p); 1263 1268 sh_error_handle(level, FIL__, __LINE__, status, MSG_E_TRUST2, 1264 1269 sl_error_string(status), tmp, tmp2); … … 1270 1275 sl_error_string(status), tmp); 1271 1276 } 1272 SH_FREE(tmp);1273 1277 1274 1278 if (status == SL_EBADUID || status == SL_EBADGID || … … 1282 1286 break; 1283 1287 case SL_ETRUNC: 1284 tmp = sh_util_safe_name (file);1285 1288 dlog(1, FIL__, __LINE__, 1286 1289 _("A filename truncation occured in the trustfile function.\nProbably the normalized filename for %s\nis too long. This may be due e.g. to deep or circular softlinks.\n"), 1287 1290 tmp); 1288 SH_FREE(tmp);1289 1291 break; 1290 1292 case SL_EBADOTH: 1291 tmp = sh_util_safe_name (file);1292 p = sl_trust_errfile();1293 1293 dlog(1, FIL__, __LINE__, 1294 1294 _("The path element: %s\nin the filename: %s is world writeable.\n"), 1295 p, tmp); 1296 SH_FREE(tmp); 1295 (p) ? p : _("(null)"), tmp); 1297 1296 break; 1298 1297 case SL_EBADUID: 1299 tmp = sh_util_safe_name (file);1300 p = sl_trust_errfile();1301 1298 dlog(1, FIL__, __LINE__, 1302 1299 _("The owner (UID = %ld) of the path element: %s\nin the filename: %s\nis not in the list of trusted users.\nTo fix the problem, you can:\n - run ./configure again with the option --with-trusted=0,...,UID\n where UID is the UID of the untrusted user, or\n - use the option TrustedUser=UID in the configuration file.\n"), 1303 (UID_CAST)sl_trust_baduid(), p, tmp); 1304 SH_FREE(tmp); 1300 (UID_CAST)baduid, (p) ? p : _("(null)"), tmp); 1305 1301 break; 1306 1302 case SL_EBADGID: 1307 tmp = sh_util_safe_name (file);1308 p = sl_trust_errfile();1309 1303 dlog(1, FIL__, __LINE__, 1310 1304 _("The path element: %s\nin the filename: %s\nis group writeable (GID = %ld), and at least one of the group\nmembers (UID = %ld) is not in the list of trusted users.\nTo fix the problem, you can:\n - run ./configure again with the option --with-trusted=0,...,UID\n where UID is the UID of the untrusted user, or\n - use the option TrustedUser=UID in the configuration file.\n"), 1311 p, tmp, (UID_CAST)sl_trust_badgid(), 1312 (UID_CAST)sl_trust_baduid()); 1313 SH_FREE(tmp); 1305 (p) ? p : _("(null)"), tmp, (UID_CAST)badgid, 1306 (UID_CAST)baduid); 1314 1307 break; 1315 1308 default: 1316 1309 break; 1317 1310 } 1318 1311 SH_FREE(tmp); 1312 if (p) SH_FREE(p); 1319 1313 SL_RETURN((-1), _("tf_trust_check")); 1320 1314 } 1315 else { 1316 SH_FREE(tmp); 1317 if (p) SH_FREE(p); 1318 } 1321 1319 } 1322 1320
Note:
See TracChangeset
for help on using the changeset viewer.